3

In my new project client has requested to use GWT/SmartGWT for developing presentation tier. (Note: Screens are not much complex) I am aware about the MVP Pattern (never used) but I need to decide which flavor of the MVP pattern I should use which meets following criteria.

  1. I should be able to integrate/use SmartGWT components seamlessly with the MVP framework.
  2. It would be great if framework provides me flexibility to support UI to be displayed on Mobile or iPad sort of devices.

I have noticed before that when components of GWT and SmartGWT used together the behavior is inconsistent. Correct me here is it true yet?

Any guidance on this would be highly appreciated.

Thanks!! Bhavesh

Bhavesh
  • 519
  • 6
  • 26

3 Answers3

4

MVP is a pattern Google created for the base GWT widgets, which do not have support for data binding built in. Google has never said that MVP applies to SmartGWT widgets, where the widgets already have support for data binding, and we (Isomorphic) strongly advise against trying to use Google MVP with SmartGWT unless you have very specific, very unusual needs (more on this here: SmartGWT GWT client server architecture)

When people try to apply MVP to SmartGWT, we see them re-creating functionality that already exists in SmartGWT, making things vastly more complicated than they need to be, and repeatedly looking for APIs and override points that aren't there because they are re-inventing things that are built into the framework. And this experience is not unique to SmartGWT - many of GWT's smartest users are complaining that MVP creates complexity and unneeded code even with the core GWT widgets.

So our advice is: start with the SmartGWT QuickStart Guide, and only look at MVP or other third-party architectural advice when you find a concrete, specific problem SmartGWT clearly doesn't address (still waiting to hear about this :).

Community
  • 1
  • 1
Charles Kendrick
  • 2,059
  • 13
  • 14
  • Thanks Charles for nice information. So according to you, it is not advisable to use frameworks like mvp4g, gwt-platform etc. with SmartGWT components. – Bhavesh Dec 14 '11 at 05:10
  • We advise against Google MVP or any MVP framework that specifically tries to handle the problem of data binding or data transfer between a model and view. Some non-Google MVP frameworks have other unrelated features that can be useful, just be very wary of adopting them - you don't want to use any of their data binding approaches, and you probably do not even want to look at them until you've become thoroughly familiar with SmartGWT best practices around data binding. – Charles Kendrick Dec 14 '11 at 23:17
  • Thank God I am in right direction. I have designed my own HMVC framework using SmartGWT 2.4 + Spring 3.0 + Hibernate 3.0 with well organized and multi-layered architecture. I am sure it will work seamlessly as my doubts on other MVP frameworks are clear now. I have not used enterprise version of SmartGWT yet but if required I will surely take a look into it. Thanks again Charles for information and guidance. – Bhavesh Dec 15 '11 at 06:43
  • Be sure to look at the new capabilities of RestDataSource in 3.0, it now supports sending multiple dsRequests in one HttpRequest, which makes it very easy to do transactions. Also, you may as well mark this answer as the answer. – Charles Kendrick Dec 15 '11 at 23:55
1

It does not play very well together, in fact most widget libraries fail in this area. It's not impossible, but not there yet.

ApriOri
  • 2,618
  • 29
  • 48
  • I am trying to integrate mvp4g with SmartGWT and facing an issue adding click handler through presenter but its not working and button is behaving like dead object. – Bhavesh Dec 13 '11 at 15:41
1
  1. Yes, SmartGWT is a component library, you'll be using their widgets just like those that come with GWT.

  2. It might work, but don't expect it'd be just like on the desktop (I had some issues with scrolling, but that might have been my mistake, we don't use smartGWT any more)

Regarding the interplay, yes, it's correct, they don't mix well, but in some cases it might work. It's better not to mix. At least that was my experience with SmartGWT 2.2.

milan
  • 11,872
  • 3
  • 42
  • 49