I am using Cayenne with Jersey frontend (http://jersey.java.net/ )  and a 
Tapestry 5 IoC container in between. Jersey is a JAX RS implementation and can 
serialize objects based on standard JAXB annotations, generating either XML or 
JSON. 

While there's no direct JAXB bindings for Cayenne DataObjects, I'd use very 
simple annotated DTO's converting between Cayenne and DTO in each Jersey 
resource class.

What I find interesting is that the DTO conversion is not simply a workaround 
for the lack of direct serialization. It actually allows to bridge the mismatch 
between the DB schema and the desired end user format of the output.

Like the above stack a lot - very simple and clean frontend code, ties nicely 
to fairly abstract backend business logic, very little configuration.

Andrus


On Aug 24, 2011, at 7:51 PM, Tony Giaccone wrote:
> I'm interested in implementing a Restful web service using Cayenne as the
> backing ORM. My guess is that there are some people on this list who may
> have opinions on how might best be implemented. My intent is to vend json to
> the clients.  I know that ROP and the hessian protocol are actively being
> used, but I don't think those have a place in what I want to build (no jvm
> on client side).
> 
> In particular there I've seen some discussions about using DTO's and custom
> template generation. I'm especially interested in how this is accomplished.
> 
> Anyone care to comment?
> 
> 
> Tony Giaccone

Reply via email to