I'm not sure if this is the best place to ask, but the question is
about dependency injection in general. We're currently using GWT for
our UI and GIN for the dependency injection. We're also trying to
follow the MVP pattern as suggested by Ray Ryan at his Google I/O
presentation. We're running into issues when one UI component contains
another, smaller, component.

For example, if we have a Contact model, ContactView UI element and
ContactPresenter. The Contact model contains an Email model. Assume
the UI represents the model object graph, so ContactView has EmailView
that it arranges alone side its other elements. If ContactView has
EmailView injected, we get into a dilemma where we don't have the
Presenter instantiated. While you could make EmailView a singleton, it
doesn't work if you have a List of EmailViews. There would be no way
to tie it to the appropriate Presenter.

The solution we've come up with is to tie the Presenters together and
have ContactView have a setter for EmailView. However, the
disadvantage is ContactView is no longer having the EmailView injected
with GIN/Guice, but by hand with a setter. Does anyone have any
suggested best practices for handling this situation? Thank you for
your time.

Best regards,
--
Arthur Kalmenson

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" 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-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to