|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
RE: Project structure with multiple modules> Hi Erik, > > Well done in presenting the requirement. I have the same > needs plus I am asked to expose the Grails/GORM domain > classes to regular java clients, and this requirement is > driving me to consider porting my domain classes to Java w/wo > Hibernate JPA. Hi Brian, Thanks for the compliment. I actually made a script (ExportDomain.groovy) which compiles my Groovy files, and packs it into a Jar afterwards. I can share it, if you want to have it. But that's just a script, and I cannot imagine that's the way it mean to. It now takes a lot of steps to build the whole application (maybe I'm spoiled by Maven), but I'm looking for a decent solution here. Erik > > - Brian > > On Thu, Apr 24, 2008 at 2:00 PM, Erik Pragt <erik@...> wrote: > > > > > > > > > > > > Hi all, > > > > > > > > Currently, I'm developing a small application with Grails > and Eclipse RCP. > > Communication should go through hessian or burlap. > > > > > > > > Currently, the project-server and project-domain are > together in one > > module, so my current directory structure looks like this: > > > > > > > > project-client > > > > project-services > > > > project-server > > > > > > > > The plan is to split this into multiple modules, like we do when > > developing something with Maven. The plan is to split it > into the following modules: > > > > > > > > project-client (RCP client, dependency on services and domain) > > > > project-domain (Groovy domain model, no dependencies) > > > > project-services (Java service interfaces, dependency on domain) > > > > project-server (The grails app, with dependencies on > services and domain). > > > > > > > > Now, I have a hard time figuring out how to do this. I'm even > > wondering if this is the right approach. If it would have > been a plain > > Java application, I would surely go for this approach, and > maybe even > > split the server into an services-impl part. But I'm using > Grails, and > > I find that some things are different. Some of the problems > I face are > > related to the Grails Domain Objects, which I want to share between > > all the projects. I don't think it's a good idea to have > two (or more) > > domain models which all represent the same domain. > > > > > > > > So I have a couple of questions: > > > > > > > > - Is it possible to put the domain model into a different > project, and > > have Grails depend on it (like Maven), while still maintaining the > > hot-reload support Grails provides? > > > > - Or, if the above is not possible: is it possible to > export the domain? > > I've created a small script now which does exactly that: > compile all > > the groovy files, put them in a jar, and even call Maven > (with a Java > > ProcessBuilder, I don't know if there's a better way..). > > > > > > > > The current approach is: compile domain, install into maven > > repository, compile the services (which have a dependency on the > > groovy domain), and after that, build the war, which have a > dependency > > on the services, because the Grails remoting plugin needs a > Service to implement an interface. > > > > > > > > So, I hope I made my problem a bit clear, but I can imagine > it's a bit > > complicated by the way I tell it. So, if you need more information, > > please let me know, but I'm really curious how you would solve, or > > have solved, a thing like this! > > > > > > > > Thanks in advance, > > > > > > > > Erik > > > > > > > > NB: Sorry for posting this here, I think it's more suited > for the user > > list, but I seem to have some problem posting on the user > list, with > > both my email addresses.... > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
|
|
|
RE: Project structure with multiple modulesHi Stephan,
Thanks for the reply! I'd still like to go for the shared domain. I can imagine that it's better to separate it to prevent tight coupling, but I don't have that problem yet, so I don't want to go there (yet). What I did now, was create a domain.jar (based on the Groovy domain) I've put in into the maven repository, and let the services depend on it. This works great, and now I can build the services. After that, I copy the services.jar to Grails, to let my Grails service implementation depend on the java service interface. Now comes the problem: when I do that, everything seems fine, but when I start the application, I get an error: NoClassDefFound: com/project/domain/Project ... It seems the library cannot find my Grails domain classes! Any idea why this is? Erik > -----Original Message----- > From: Stephan M. February [mailto:stephan@...] > Sent: vrijdag 25 april 2008 9:22 > To: dev@... > Cc: dev@... > Subject: Re: [grails-dev] Project structure with multiple modules > > Hello Erik > > I recently also did a remote RCP application which has to > communicate with my Grails app. My approach was to structure > my application in the traditional 3-tier approach > > 1) Domain Objects ------ > 2) Business Methods exposing > remote APIs -----> 3) Remote client > > In my approach my remote RCP client (3) communicates with my > business methods (2) via XML-RPC. > I did not use the existing Groovy XML-RPC plugin, but instead > opted for rolling my own Grails Service which handled XML-RPC > requests via Apache XML-RPC. The benefit of this approach is > that you don't need to have such tight coupling between your > Grails domain model and the remote RCP app. > > Additionally, I managed to use Groovy in my RCP application > (painful to build and package, but very *grooy* :) ). > > Regards > Stephan February > Adeptiva Linux Pte Ltd > Co. Reg: 200404633R > > ----- "Erik Pragt" <erik@...> wrote: > > Hi all, > > > > > > > > Currently, I'm developing a small application with Grails > and Eclipse > > RCP. Communication should go through hessian or burlap. > > > > > > > > Currently, the project-server and project-domain are > together in one > > module, so my current directory structure looks like this: > > > > > > > > project-client > > > > project-services > > > > project-server > > > > > > > > The plan is to split this into multiple modules, like we do when > > developing something with Maven. The plan is to split it into the > > following modules: > > > > > > > > project-client (RCP client, dependency on services and domain) > > > > project-domain (Groovy domain model, no dependencies) > > > > project-services (Java service interfaces, dependency on domain) > > > > project-server (The grails app, with dependencies on services and > > domain). > > > > > > > > Now, I have a hard time figuring out how to do this. I'm even > > wondering if this is the right approach. If it would have > been a plain > > Java application, I would surely go for this approach, and > maybe even > > split the server into an services-impl part. But I'm using > Grails, and > > I find that some things are different. Some of the problems > I face are > > related to the Grails Domain Objects, which I want to share between > > all the projects. I don't think it's a good idea to have > two (or more) > > domain models which all represent the same domain. > > > > > > > > So I have a couple of questions: > > > > > > > > - Is it possible to put the domain model into a different > project, and > > have Grails depend on it (like Maven), while still maintaining the > > hot-reload support Grails provides? > > > > - Or, if the above is not possible: is it possible to export the > > domain? I've created a small script now which does exactly that: > > compile all the groovy files, put them in a jar, and even > call Maven > > (with a Java ProcessBuilder, I don't know if there's a > better way..). > > > > > > > > The current approach is: compile domain, install into maven > > repository, compile the services (which have a dependency on the > > groovy domain), and after that, build the war, which have a > dependency > > on the services, because the Grails remoting plugin needs a > Service to > > implement an interface. > > > > > > > > So, I hope I made my problem a bit clear, but I can imagine > it's a bit > > complicated by the way I tell it. So, if you need more information, > > please let me know, but I'm really curious how you would solve, or > > have solved, a thing like this! > > > > > > > > Thanks in advance, > > > > > > > > Erik > > > > > > > > NB: Sorry for posting this here, I think it's more suited > for the user > > list, but I seem to have some problem posting on the user > list, with > > both my email addresses.... > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Free Forum Powered by Nabble | Forum Help |