Thanks Thomas.

So the way I understand it, the ActivityManager/ActivityMapper are GWT
2.1 equivalent's of GWTP's proxy for the purpose of navigation. It's
just that in GWTP you don't need to create or modify a separate class,
all is done within your presenter.

In my apps, I often have some presenters that need to be awoken when a
given message transit on the bus. Say, for example, a ChatBoxPresenter
would like to wake up when a NewChatMessageEvent transits on the bus.
In GWTP it's simply a matter of annotating a method with @ProxyEvent
in the presenter -- ChatBoxPresenter is still lazily instantiated and
code split. How would you handle such a case in GWT 2.1 short of
instantiating the ChatBoxPresenter at app start?

In the GWTP samples we use singleton presenters, which makes it easy
to retain state during the app lifetime, a frequent use case. Also, it
cuts down on the cost of instantiating and garbage collecting the
presenters all the time. Finally, singleton presenters ensure that you
don't mistakenly attach two instances of the presenter to the same
singleton view. However, nothing prevents you from using non-singleton
presenters. GWTP presenters have the equivalent of a resettable event
bus, and every handlers are unregistered upon an unbind(). In fact,
GWTP offers reusable components separating logic from (non-singleton)
views -- which we call PresenterWidget. These are quickly becoming one
of the most popular feature of the framework and I don't find their
equivalent in GWT.

@Nicolas, Re: the need for a proxy interface
I believe it is a limitation of GWT generators that they have to be
attached to classes/interfaces. If anybody has a better idea I'm a
buyer. But isn't it better than manually writing/editing
ActivityManagers?

Cheers,

   Philippe

On Nov 8, 1:35 am, Nicolas Antoniazzi <[email protected]>
wrote:
> Hi Phillipe,
>
> Also, I think it's a bit unfair to call GWTP's code generation "magic"
>
>  when GWT relies on it for so many different things... But if you
>
> > really want to write proxys yourself, GWTP's allows it.
>
> Yes, I agree that I was a bit unfair with GWTP. In my opinion, it would be a
> geater tool (for me) if the code in front of generators were more concise
> (just annotation, no empty interfaces to add), and maybe more "optional".
> bindPresenter() needs view, proxyplace, presenter. But if I prefer to not
> use ProxyPlace as you suggest, I can't.
>
> > Out of curiosity, which version of GWTP did you try?
>
> 0.4. But I might not have been in the depth of the framework (Just coded 4
> main pages of my app) until I get blocked by the Top Div/RootPresenter
> problem that I explained before.
>
> Cheers,
>
> Nicolas.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to