My application is logically divided into a server that contains my Grails objects and domain controllers; and the client where I have Ext GWT classes that create all the pages of the user interface.
For user interface requests, I use an AJAX call for a controller method that returns, for example, a list of domain objects as a JSON structure.
Following the DRY principle, I would not want to "serialize" the domain data to a JSON string on the server, and then de-serialize it on the client to another structure - I would like to use the Domain object I already have, I do not need to change several places when I add, modify or delete a new field.
Question: is this a good way to go?
If so, how could you make .groovy domain objects accessible on the "client side" of the GWT Java class?
If not, why is it bad and what would you advise instead?
source
share