Thursday, July 1, 2010

Re: Creating new Presenter/View in a Presenter

Hi.

You might also want to keep an eye on the recent GWT 2.1 development
(still at milestone maturity level) on MVP, as described in this video
at Google IO 2010:

http://www.youtube.com/watch?v=M5x6E6ze1x8

Instead of AppController, Presenter and Displays you would have
ActivityManager, Activities and Views. The design pattern is the same,
just the building blocks a little different.

You mentioned you intend to write a big app, so you might be tempted
at some time to go for one of the available libraries/frameworks for
MVP, which might force you to rewrite a lot of code to be ported to
2.1.

On Jul 1, 12:08 pm, Jyaif <jfgeye...@gmail.com> wrote:
> Ok, I'll look into GIN.
> Thanks!
>
> On Jun 30, 8:17 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
>
>
>
> > On 30 juin, 17:31, Jyaif <jfgeye...@gmail.com> wrote:
>
> > > Hi,
> > > I am beginning to work on a big app created in GWT and I have a
> > > question regarding the MVP pattern in GWT.
>
> > > I have readhttp://code.google.com/webtoolkit/articles/mvp-architecture.html,
> > > and I understand that the AppController creates Presenters, and
> > > provides them a rpcService, an eventBus, and a view.
>
> > > This makes it easy (among other things) to target mobile phones or
> > > desktop computers by submitting different views to the Presenters
>
> > > However, if one of the Presenter creates some widget, also programmed
> > > in a VP fashion, it will be the Presenter's responsibility to
> > > instantiate the view for the widget :-(
> > > How can I make it so the Presenter knows what kind of view (mobile
> > > phone/desktop) it has to create?
>
> > > Should I submit to all my Presenters a Factory with the methods
> > > newViewForWidgetA(), newViewForWidgetB(), etc... ?
>
> > Yes, more or less. But I'd encourage you to use some dependency
> > injection framework, such as Google GIN, to make this waaaay easier to
> > write and maintain.

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment