I'm new to Grails and I'm facing some problems sharing my domain model between three different applications. Two of them need to persist model objects, and the third don't.
It seems the usual approach to manage this is by the creation of a plug-in and putting the domain classes in it. The problem is that the domain classes include specific persistence information, and there are some differences in the way each application persists the objects.
Moreover, one of the applications does not need to persist those objects at all, as it retrieves and deletes them using a JSON web interface from another. When I run this application in mode dbCreate = "create-drop"
, Grails creates unwanted tables for those classes on startup.
I think all the problem comes from mixing the model and persistence specific information in the domain classes. How can I solve it? Is there a better approach I'm missing to share domain model?