More on this "EJB3 persistence renders DAOs obsolete":

We typically do not use DAOs in front of highly-complex RAM-based data 
structures.  So what makes databases so special that a DAO pattern emerged?

DAOs became popular in the JDBC days, when you had

queryMethod() { 
    let's say 100 lines of JDBC code to get a list joined with a set
}

Then came Hibernate, and people argued more weakly for DAOs. The argument I saw 
said DAOs were good for abstracting different database types (mysql vs. 
postgresql, etc).

Now with EJB3 we have a situation where the old pattern, DAO, has such weak 
arguments that eliminating DAOs should be considered "reasonable", and that 
using a DAO should require justification.

Here's our new line of code:

List resultList = 
  em.createNamedQuery("userFavoritesEntity.findByUser")
    .setParameter("user", user)
    .getResultList();

Should this code be in the class that calls the entity?  Should this code be in 
a static method on the entity?  Those are questions for a later discussion.  
The question I pose here is whether this code justifies a new class, a DAO.

In other words, does EJB3 persistence render DAOs obsolete?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3929135#3929135

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3929135


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to