« Return to Thread: Re: Project structure with multiple modules

Re: Project structure with multiple modules

by Stephan M. February :: Rate this Message:

Reply to Author | View in Thread

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


 « Return to Thread: Re: Project structure with multiple modules