MVP, GIN, UiBinder

51 views
Skip to first unread message

P.G.Taboada

unread,
Dec 9, 2009, 6:50:04 AM12/9/09
to Google Web Toolkit
Hi,

as many other GWT developers I really like the above mentioned
approaches.

I am having a little bit of pain when it comes down to embedding views
into views. UiBinder and GIN don't play well together, I am struggling
with ugly locator pattern usages to create my sub/ embedded views. My
code is now full of //WORKAROUND task tags, hoping to get it solved
somehow someday.

But that is the point: at which direction should I look? MVP tells me
to have views injected into my presenter, really nice. UiBinder on the
other hand needs the views, would create them properly, but then they
would not be available to GIN (compile-time vs. runtime).

If my feeling is right, we would need some way to hook up into the
UIBinder, providing a GIN based MVP resolver, quite similar to the
variable resolvers people use in JSF to get hands on Spring beans from
JSF. But as far I can see, UiBinder does not provide such extension
point.

Any thoughts here?

brgds,

Papick G. Taboada



Thomas Broyer

unread,
Dec 9, 2009, 10:13:52 AM12/9/09
to Google Web Toolkit
How about injecting your "child views" (or Provider<>s) into your view
and then use @UiField(provided=true) to tell UiBinder you're providing
those widgets?

P.G.Taboada

unread,
Dec 9, 2009, 10:30:49 AM12/9/09
to Google Web Toolkit
Well, that is what I am sort of doing. And it turns out to be a kind
of service location.

There are some workarounds, and they are nothing more than just that:
a workaround.

I am letting GIN build all of my presenters, and then I let them bind
the UIs.
Not nice, but that is the way with the fewest dependency lookup calls
for me atm.

Tristan

unread,
Dec 15, 2009, 12:01:11 PM12/15/09
to Google Web Toolkit
Would you be able to provide a sample non-trivial example? ie
injecting a child view into a parent view? I have been trying to do
this and I get a runtime error of ClassNotFoundException when the
provider tries to do "new ParentView(childView)".

Marko Vuksanovic

unread,
Jan 15, 2010, 7:26:57 AM1/15/10
to Google Web Toolkit
Hi,

I have been working on implementing Event Bus and MVP pattern in a GWT
1.7 project. Recently I have also implemented the same patterns using
GWT 2.0. You can checkout the following project:

http://code.google.com/p/gwt-event-bus-research/ (gwt 2.0 example is
found in _current_ folder).

Hope this helps...

Reply all
Reply to author
Forward
0 new messages