Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails & backbone.js

ive currently been developing a Java EE project, using regular web services and backbone.js for my front end. (As i like things being loaded/added to the page, without the page refreshing (async, backbone)).

I wanted to find out if anyone has used grails along with backbone and what their experience is?

Grails would be for server side stuff, and backbone for handling the front end.

Or can grails do this itself. IE, with grails, can you dynamically load stuff onto a page without refreshing. For example, a todo list.

Is it difficult to add backbone to grails?

like image 624
Tyler Evans Avatar asked Jul 29 '12 07:07

Tyler Evans


2 Answers

I've used Backbone + Grails, for two projects. And didn't see any problem, absolutelly.

Backbone is client-side only framework, very flexible, developed with idea that it should be compatible with nearly all server-side stuff. It just expecting RESTful/RESTful-like server side API. And also, you can alway use your own server-client transport implementation, see Backbone.sync (but I'm sure, you don't need it for standard Grails app)

Grails, at other hand, it very flexible server-side framework (mostly server-side). By using Grails you can make RESTful api w/o any problem. Basically you just need to respond with JSON, that's enough.

PS you can also use Grails tags for ajax, like remoteLink and plain jQuery, but Backbone is much more powerful (and easy to learn)

like image 142
Igor Artamonov Avatar answered Oct 18 '22 10:10

Igor Artamonov


It's not that complex. You can try following this tutorial. It's a Grails 2.x & BackboneJS project, which utilises the resources plugin.

like image 45
chanwit Avatar answered Oct 18 '22 11:10

chanwit