Desgin approaches to EJB3.0 apps

DeveloperWorks have an article that introduces a design approach for applications using the EJB3.0 spec and the JPA API.

The approach outlined in this article suggests using Stateless Session Beans as your DAOs, using the JPA API directly in order to manipulate your Entity beans.

While this is ok and it works, I am not sure that this approach gives you the best separation of concerns. Sure, the Session bean has long been used for it’s main purpose to demarcate transactions with CMT (even prior to EJB3.0), but this feature can still be used if you lift is persistence code out of the bean implementation itself and put it in a persistence specific DAO class.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.