I am doing some research on Grails and writing about what the future holds for it..
Something interesting jumped out in the RoadMap (http://grails.org/Roadmap)
GORM for REST
Anyone with more experience with Grails than me know what this would entail?
I am guessing some sort of CRUD operations through Web Services instead of using Hibernate to connect to an SQL database?
GORM is the data access toolkit used by Grails and provides a rich set of APIs for accessing relational and non-relational data including implementations for Hibernate (SQL), MongoDB, Neo4j, Cassandra, an in-memory ConcurrentHashMap for testing and an automatic GraphQL schema generator.
Grails provides a development environment that includes a web server to get developers started right away. All required libraries are part of the Grails distribution, and Grails prepares the Java web environment for deployment automatically.
flush (optional) - When set to true flushes the persistence context, persisting the object immediately and updating the version column for optimistic locking.
there is a JSON RESTful API for GORM which gives some insight on what GORM for REST
is like:
As far as to RESTy GORM that is scheduled for Grails 2.0, here is the GORM Virtual REST domain objects discussion on Grails mailing list:
I am currently evaluating the use of grails to connect to other backend systems. Would it be possible to let the domain layer talk to CRUD REST services instead of a Database? It would be a bit like a XML backend.... We have got a very big backend where it is difficult to implement business logic, but we can manage to provide restful services. My idea is to have grails as a business / web application layer on top to deploy various systems to cross platform
This feature is scheduled for development for Grails 2.0
-- Graeme Rocher
I think the intent is to apply the scaffolding pattern to a RESTful API out of the box. There has been a JIRA entry around for several years for this.
Resulting JIRA: http://jira.grails.org/browse/GRAILS-2823
I also wouldn't be surprised if they took the dynamic finder idea and applied it to URL patterns.
GET /book/findByTitle/Dune
or
GET /book/findByTitle?title=Dune&format=json
or something like that.
I don't know exactly what is on the roadmap, but I imagine that the final product will have scaffold functionality (list,view,create,update,delete) through a RESTful interface plus some URL patterns that correspond to what you can currently do with the dynamic finders that GORM provides.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With