Hi All,

I think I get MVP and many of the Ray Ryan application design
concepts.

One thing I'm struggling with is an elegant design approach for
managing state across presenters.  Take the Contact List example where
the user can create/update Contacts.  So for my "state" scenario, the
user can create/update many Contacts before anything gets committed to
the server and then there's a big "Save" button on the page the user
would click to send all their created/modified Contacts to the
server.

The ContactDetailPresenter only presents one Contact for creation/
modification.  In this case, the ContactDetailPresenter should not
really be interacting with the RPC Service, right?  Even if the RPC
Service has some sort of "Caching" decorator, it still doesn't seem
like a good fit.  Do people introduce a "StateService" in to the mix
that's more local to the page.  The ContactDetailPresenter would
interact with that StateService to retrieve a Contact to modify.
Then, when the user clicks "Save", the StateService would interact
with the RPC Service to commit the changes to the server?

Another approach is that there no "StateService".  It's just some
PagePresenter that holds the state, Contacts, for the page and injects
it in to the ContactDetailPresenter as needed.   Then the
ContactDetailPresenter doesn't have a handle to the RPC Service; it
just gets a Contact injected in to it by the PagePresenter.  I'm sort
of leaning this way, but want to make sure I'm not missing something.

Hope the question makes sense.  Any feedback is appreciated!

Thanks,

Eric

(I understand this page-wide Save isn't all that usable for Contact
List, but I think it will make sense, for the application I'm working
on, that data isn't committed to the server every time a user finishes
with a particular Presenter.)

-- 
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