Thursday, October 22, 2009

Roo Karaf


Just came across Craig Wall post on Roo/OSGi Blueprint/Karaf. I've been fooling around with Roo lately and similar idea of deploying Roo code as OSGi bundle has occurred to me. In particular I like the Roo Rich-Domain-Object concept; the implementation using inter-type declaration and add hosts of functionality to the domain class ... and so on. But I don't care too much about the SpringMVC based web layer personally.



I have tried out some of the Roo tutorials. Since most of them are web-oriented applications, I got this wrong impression that Roo always create a WAR project. So the lingering question on how it is best to break a Roo project up into separate modules/artifacts (maven) has been in my mind for a while.



Then this article shed the light. When you first create a project in Roo, the packaging is a JAR, and the pom has minimal dependencies. The JPA stuffs are added to the pom when you create the first entity. Now if you package the project at this point, you still get a JAR. Now if you create any controller, Roo turn the project packaging to a WAR.



So, looks like it is feasible to just use Roo to build the Rich-Domain-Object and deploy it to an OSGi container. The complete picture would be to build a OSGi service layer on-top/side-by-side of the domain bundle exposing the service endpoint as jax-ws/jax-rs. And then a RIA web client consuming jax-rs services (may be something like the Sakai Fluid/Uxloader). 





No comments: