JSON+RequestBuilder vs RequestFactory

276 views
Skip to first unread message

zixzigma

unread,
Nov 17, 2010, 2:59:55 AM11/17/10
to Google Web Toolkit
Hello everyone.

What are the benefits of using RequestFactory over JSON/Request
Builder.

to implement client-side communication/persistence i have to options:

1- using Spring/Spring MVC on the server to handle all the server-side
work,
and send JSON data to the GWT client.

2- i believe I still can use SpringMVC with RequestFactory, though not
as cleanly seperated as the first approach.

all the code will be in Java.

What are the benefits of using RequestFactory over JSON/
RequestBuilder ?


Thank You

Thomas Broyer

unread,
Nov 17, 2010, 9:10:47 AM11/17/10
to Google Web Toolkit
- serialization/deserialization code is generated for you
- partial objects (you ask for the properties you need using .with()
and only those goes to the wire)
- AFAICT, the immutable object is shared across responses (and
updated as responses come back from the server)
- events (dispatch on an EventBus) about objects having been
persisted/updated/deleted on the server (as side-effects of requests
from that one client –no broadcast– *and* the
RequestFactoryEditorDriver listens to them to automatically update the
display)
- built-in JSR303 validation (after deserialization but before
invoking the "operation" on the server-side) sending back results as
Violations on the client-side (*and* you can ask the
RequestFactoryEditorDriver to display those violations, which is not
possible with the SimpleBeanEditorDriver, see issue 5567)

Of course, there are limitations too and, as always, some of the
benefits listed above come with drawbacks.

m1kema

unread,
Nov 2, 2013, 3:09:20 PM11/2/13
to google-we...@googlegroups.com
Hello zixzigma,

Did you ever come up with a resolution here ?

I'm new to GWT, and we currently have a Spring MVC backend, that we would like to communicate with.

Were you able to integrate which such a backend ?   if so, which option(s) did you go with, and do you have any example of such ?

Thanks for any help that you may be able to provide.

- Mike

m1kema

unread,
Nov 2, 2013, 3:11:57 PM11/2/13
to google-we...@googlegroups.com
Not sure if my first question went in ... Checking to see, if you were able to come up with a resolution to your question ?

We have an existing Spring MVC backend, that we would like to hook up to an GWT front-end.  Have similar questions/issues in terms of how
we would like to communicate with backend (e.g., RequestBuilder, RequestFactory, etc) and if it is possible for GWT and Spring MVC to co-exist.

Thanks,

Mike

On Wednesday, November 17, 2010 1:59:55 AM UTC-6, zixzigma wrote:
Reply all
Reply to author
Forward
0 new messages