best architecture for GWT + Spring

781 views
Skip to first unread message

Ernesto Reig

unread,
Jul 14, 2011, 7:15:46 AM7/14/11
to google-we...@googlegroups.com
Hello everybody.
I have been discussing this topic with some collegues and we would like to know the "GWT community" expert opinion :)
As the title says, the discussion is about the best architecture (or best practices) for building enterprise web applications with GWT and Spring, and the different options available are:

 - GWT MVP front-end + Spring MVC + Spring architecture back-end*.
 - GWT MVP front-end + Spring architecture back-end*.
 - Spring MVC + GWT components inside html´s and JSP´s + Spring architecture back-end*.

*Spring architecture back-end is composed of several different maven modules/projects (separated by functionality) each one made with Spring.

From my point of view, the best option is the second one. With that option you are not mixing concepts nor using two design patterns together for the same thing (GWT MVP and Spring MVP), which I think is nonsense. Also you can develop the GWT part completely independent with the back-end part (with no Spring MVC in the middle). So you can make the front-end part with GWT, thus using the GWT best practices and features like Activities, Places, RequestFactory, etc. And the back-end part focusing on every module independently, using the technologies you want (Spring in this case) for each one.

What do you think about this? Every point is appreciated.

Thank you very much.

dmen

unread,
Jul 14, 2011, 7:49:52 AM7/14/11
to Google Web Toolkit
I have been using the first option, with Spring MVC acting as a
restful web service layer. See for example:
http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/

The upside is that the server side is completely unaware of the client
side technology. Indeed I have been reusing some common services with
either GWT, ExtJS and jQuery in different applications.

The downside is that you loose all the GWT RPC convenience.

cri

unread,
Jul 14, 2011, 9:04:49 AM7/14/11
to Google Web Toolkit
Definitely #2 for the reasons you mentions, with the GWT RPC server
side attaching to the Spring application context.

t.dave

unread,
Jul 14, 2011, 5:21:46 PM7/14/11
to Google Web Toolkit
i'd also agree with going the route of #2, and keeping GWT-RPC for
convenience. yes, it's nice architecturally to say your client and
server are loosely coupled via JSON, but in practice writing JSNI
objects to read the JSON is hard to debug and can be rather tedious.

i did that previously with a grails backend, and because grails at
that point was unproven to me wanted to be able to swap it out for
something later and not even tie myself into a java backend. i
wouldn't recommend it. unless you have requirements that you can't
have a java backend or really don't think it's going to last, i'd keep
GWT-RPC and have that attach to spring as the previous poster
mentioned.

you might also have requirements of different (non-GWT) clients
calling your restful server side and still want to go with JSON, but
again i'd think about having multiple input/output formats (GWT-RPC,
JSON, XML, etc) all calling into the same services layer instead of
trying to standardize on one input/output data format.

hope that helps!


ps. only my $.02, not necessarily an expert opinion. :)

Ernesto Reig

unread,
Jul 15, 2011, 5:05:59 AM7/15/11
to google-we...@googlegroups.com
But you are talking about option #2 with GWT-RPC, what about option #2 with RequestFactory?

Tom Meech

unread,
Jul 15, 2011, 7:23:31 AM7/15/11
to google-we...@googlegroups.com
I've been using GWT-Dispatch with Spring and have been very happy with the results.

Juan Pablo Gardella

unread,
Jul 15, 2011, 7:35:18 AM7/15/11
to google-we...@googlegroups.com
I vote option #2 with gwt-dispatch too. 

2011/7/15 Tom Meech <tom....@gmail.com>
I've been using GWT-Dispatch with Spring and have been very happy with the results.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/JB6Ddh_flOoJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

刘斌

unread,
Jul 14, 2011, 10:04:50 PM7/14/11
to google-we...@googlegroups.com
GWT MVP+Spring MVC+ spring back-end + hibernate
use the spring service bean to deal with bussiness logic integrate with hibernate, use gwt_sl connect GWT RPC with spring service bean, so you configuration all concentrate in the spring xml file
rather than add servlet to web.xml


2011/7/14 Ernesto Reig <erni...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Jeff Larsen

unread,
Jul 15, 2011, 4:22:39 PM7/15/11
to google-we...@googlegroups.com
Why Spring-MVC?

Ernesto Reig

unread,
Jul 19, 2011, 3:52:55 AM7/19/11
to google-we...@googlegroups.com
Yes, that´s the key question about gwt + spring. Do you really need Spring MVC?


Reply all
Reply to author
Forward
0 new messages