Another approach that wasn't mentioned but that I use quite frequently is to use the history and pass the information as parameters in the history token. This is made really easy in frameworks like gwt- presenter and gwt-platform and has a number of advantages provided the parameter is serializable (and small enough). For example, it could let the user bookmark the detail page of "Lady_Gaga". A bit trickier when the presenter is a dialog box, but totally doable.
On Jul 20, 11:34 am, Mikael Couzic <mikaelcou...@gmail.com> wrote: > Well, I pretty much agree with Eric. I believe the event should'nt > depend on the listeners, rather it should be defined in consideration > of the presenter that fires it. The attributes stored in the event are > the ones that make sense in its own context (that helps a lot I know > ^^). > In your registration example, I'd fire a RegistrationSubmittedEvent > that holds all the details of the registration. No need to create a > data object, your event is your data object. However, you can > instantiate model objects in the presenter and hold these objects in > the event instead of duplicating instantiation code all over the > listeners. But in that case, be careful, your model objects are shared > and shouldn't be edited (consider making them immutable). > > I hope that helps ! > > On 20 juil, 18:07, mk <munna.kaka.ch...@gmail.com> wrote: > > > > > In case future presenter 3q requires a specific information which is > > not sent in the old event thrown by presenter 1. > > Than in future, we have to add that specific information in the event > > thrown by presenter 1 .. right ? > > > I mean information passed in the event is limited by what is required > > by listening presenters?. > > > For eg a registration view may have different textboxes for first > > name, address etc and the intial event may only be thrown with the > > information that "submit button is clicked". And later on for future > > presenter 3q we may have to add first name in the event thrown by > > presenter 1. > > > Do you create event in the first place with all the information > > available to accomodate all future presenters? > > Do you create a "Value object" to pass this heavy weight information > > from one presenter to another? > > > Thanks in adv....Plz respond.... > > > On Jul 20, 8:21 am, Eric <erjab...@gmail.com> wrote: > > > > On Jul 19, 9:04 pm, mk <munna.kaka.ch...@gmail.com> wrote: > > > > > Thanks a lot. > > > > > Now if there are three DIFFERENT presenters (say 2a,2b,2c) listening > > > > event from 1st presenter. > > > > Than do 1st presenter has to create event with all the appro. values > > > > required by 2a,2b,2c presenters? > > > > In fact, you shouldn't be thinking about presenters 2a, 2b, or 2c > > > when writing presenter 1. Presenter 1 should just fire change > > > events when its data changes. Presenters 2a, 2b, 2c, and future > > > presenters 3q and 7f should simply add event handlers to > > > presenter 1 and pick out the information they need. > > > > Eric -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.