I have been studying http://blog.appenginefan.com/search/label/Schluesselmeister
application, and that got me to thinking about MVP... In that example,
"Display" is about the same as "View", and "Controller" is like
"Presenter". You inject the View to the Presenter through its
constructor... but then the Presenter injects itself into the View by
doing something like View.setPresenter(this);

There are benefits, but having the View know about the Presenter seems
odd.

You could have:
LoginPresenter.View interface:
    String getName( );
    String getPass( );
    void setPresenter(Presenter p);

LoginView.Presenter interface:
    tryToLogin( )

LoginPresenter implements LoginView.Presenter with something like:
    // call a remote service with myView.getName( ) and myView.getPass
( )
    // on callback, if the service agrees, initialize everything, show
the menu, etc.

LoginView implements LoginPresenter.View with something like:
    // add a click handler to its "login" button
    // which will call presenter.tryToLogin( )

The LoginPresenter constructor looks like
    LoginPresenter(LoginView view ...and some other parameters...)
        myView = view;
        myView.setPresenter(this);
        ...

This way of implementing things doesn't require sending events from
the view to the presenter, or the presenter providing callbacks to the
view... but somehow looks weird to me... any thoughts on it?
--~--~---------~--~----~------------~-------~--~----~
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