Re: GWT + Rails still a good match for you?

2 views
Skip to first unread message

David Stubbs

unread,
Dec 14, 2007, 10:42:15 AM12/14/07
to Nathan Clark, Google-We...@googlegroups.com
Hi Nathan,

I don't want to miss lead you, so up front the application we are
building with GWT and Rails isn't in production yet, in fact it's
still in it's embryonic stages. But here's our progress so far.

We have stuck with rails on the backed for one reason - ActiveRecord.

In honesty it's been a very pain full few weeks with GWT and Rails, in
part due to are lack of experience with GWT and the effort involved
syncing data classes between GWT and rails, but we are getting there.

The solution we've come up with is to auto generate a mirror of every
ActiveRecord model (with its associations) in java. We did look at GWT
generators, but it's proved much easier to generate the java classes
using a rake task in ruby. We use json to pass data to and from the
server, and the GWT-Jsonizer to receive the json on the GWT side and a
custom (autobuild) function in the java models to generate json data
to send back to the server. There are a number of helper functions
we've created to generate and receive the json data, so much of this
is now automated for us.

This allows us to request, create and modify the data objects client
side ,then send an object graph, in json, to the server. It's synced
to ActiveRecord in a transaction and saved. Any validation/save errors
in the object graph aborts the transaction, the errors (ActiveRecord
errors) are sent back to the client side. Now its working it fairly
cool.

In the end we've ended up with a platform that should keep us happy
for some time to come, that is unless ActiveObject proves itself in
another application we're building...

It's been a lot of pain, but - it's been worth it. No browser funny,
(except css) debugging client code, and static typing has been
fantastic, beats using raw javascript..

- http://code.google.com/p/gwt-jsonizer/
- https://activeobjects.dev.java.net/ (http://www.codecommit.com/blog/java/an-easier-java-orm
)

David

On 12 Dec 2007, at 06:56, Nathan Clark wrote:

> Hi,
> The team I'm working on has started to use gwt quite a bit for the
> frontend of a sizable project.
> I have been kicking around the idea that GWT and rails can be
> leveraged for the best of both
> worlds. I found some posts you made on google, seems you have the
> same idea I have.
> Do you find rails backend is still a good match for a GWT frontend?
> Would you mind if I asked
> more questions on the topic?
>
> Cheers,
> Nathan
>
> --
> Together we can solve any issue.

Reply all
Reply to author
Forward
0 new messages