|
From: Ryan J. M. <ry...@da...> - 2008-07-16 12:28:47
|
On Jul 16, 2008, at 6:06 AM, Christian Bauer wrote: > > On Jul 16, 2008, at 11:59 , Martin Algesten wrote: > >> I think it feels wrong to receive a Customer object in set() which >> is supposed to be myself (sure I can copy the values over from one >> to the other). Pulling the @PUT method up to the CustomerDatabase >> class is a solution, but then I don't keep my operations together, >> so that feels wrong too. In my own test implementations I've ended >> up creating a wrapper resource around every entity which feels right >> since I get a clean API separation from my domain model. My only problem with the resource-per-entity approach is that, for the most part, you're repeating very similar activities for different entities. To me, that doesn't feel right. Hibernate and JPA abstract the persistence details enough that it should be possible to build a layer around > Agree on that, I think it's the job of a CRUD framework like what Seam > can offer. Even for simple applications I would not put resource > annotations into my domain model. Or at least only annotations but no > special methods. +1. I absolutely don't want special methods, but something more transparent. > > One of the points I brought up is RESTEasy integration with the Seam > built-in controllers/homes/queries: > > http://docs.jboss.com/seam/2.1.0.A1/reference/en/html/framework.html This is probably closer to what I'm looking for, but I haven't taken a deep enough look into it. For now, I'll put this to rest and finish the example ;) Ryan- |