On Mon, Jul 23, 2012 at 11:19 AM, netdawg <net.d...@yahoo.com> wrote: > I have been reading some tapestry DAO resources: > http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/userguide.html > http://tawus.wordpress.com/2011/05/28/tapestry-magic-13-generic-data-access-objects/ > http://www.infoq.com/articles/tapestry5-intro/ > Curious, if there is a standard, established, best-practice, data access > object (DAO) pattern or convention? > 1. Is there a specific "DAO" package (directory structure for resources)? > Like there is for "entities", "pages", "components", etc? Or is pretty much > free-form?
In Tapestry it's a service. It's pretty typical to have services like UserService, MyDomainObjectService etc. One thing there's no common convention is transaction management. I like managing transactions on the page layer since you can actually do something about it there but how you want to handle transactions depends on whether your are using a JavaEE container or spring and your overall architecture etc. > 2. I would like the DAOs to be RESTful API...any good examples? Or is it > implicit through the page activation context as mentioned in the infoq blog? You do have to think about the input/output data format if you want to publish your interface. JAX-RS is the Java standard for REST services and Tynamo.org provides a pretty handy integration with JBoss' RESTEasy (an implementation of JAX-RS), see http://tynamo.org/tapestry-resteasy+guide for more info. Kalle --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org