You catched me perfectly. I'm just researching if something like I described here exists. I'm doubting about being exagerating, perhaps this is the problem. :)
My only question now, is "what about tapestry-jpa?" isn't it an abstraction for my scenario? It hasn't documentation yet, but Piero, correct me if I am wrong, if I use the tapestry-jpa interfaces into my DAO implementation, I would be de-coupled from the JPA implementation that I will be using at runtime, right? Anyway, I don't know how I could inject a org.hibernate.EntityManager in the javax.persistence.EntityManager, since they don't share any interface. Am I crazy? or it is something interesting? :) Regards, Matías. Thiago H. de Paula Figueiredo wrote: > > On Tue, 12 Jan 2010 11:11:12 -0200, matias.blasi <matias.bl...@gmail.com> > wrote: > >> public class UserDAOImpl { >> >> @Inject >> private some.standard.persistence.api.Session sessionManager; >> >> @some.new.annotation.not.coupled.with.any.technology.CommitAfter // >> <- >> I knwo, it should be in the interface >> @Override >> public void createUser(User user) { >> this.sessionManager.persist(user); // I want this code to >> work >> with any persistence technology, I know that it is a very small >> 'reutilization' but, I am thinking in all my business modules, present in >> many applications. >> } >> } > > I'm sorry, but it still doesn't make sense to me. A DAO is a way to > decouple the rest of the application of the details of the persistence, > but you're trying to decoulbe the DAO from the details of the persistence. > This looks like overengineering to me. > >> I would need some mechanism, which knows about the current data layer >> implementation I want to use (i.e. hibernate or any ohter else), > > That's exactly the description of what a DAO does. What you want is a DAO > for your DAOs. I'm concerned with reuse and flexibility as much as you, > but I think you're exagerating here. > >> then my DAO impl will not need to be re-written for multiples >> technologies. > > You want an abstraction layer over and around persistence frameworks. I > don't know of any. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27127590.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org