In the commercial world, EJBs have almost totally been supplanted by Spring. The advantage of Spring is that it can be run inside a simple Web container like Jetty or Tomcat whereas EJBs (pre-3.1) require a J2EE application server (eg Websphere, Weblogic, JBoss, Glassfish), which has a larger footprint.
EJBs do a couple of things well, most especially stateless session beans, which can be an efficient avenue for distributed transactions.
EJB since 3.0 has been split into two parts: the EJB spec and the JPA spec. JPA (Java Persistence API) is as the name suggests the persistence part of the API. This is really commonly used in libraries like EclipseLink, Hibernate and Toplink. Hibernate is the most popular and predates JPA but the differences aren't so large.
JPA is a form of ORM (object-relational mapper) of projecting an object model onto a relational database.
JPA is, in my experience, used much more commonly than EJB.
No comments:
Post a Comment