Skip to Content
Just came across this newsbit that EJB 3.0 Proposed Final Draft Specification is now available. So had a quick look and it looks quite neat as the title of the JSR 220 sugests “The purpose of Enterprise JavaBeans (EJB) 3.0 is to improve the EJB architecture by reducing its complexity from the developer’s point of view.”.

My first impression is it looks so straightforward as number of program artifact have reduced. In EJB 3.0, all kinds of enterprise beans are now POJO (Plain Old Java Objects) with appropriate annotations. For example, a stateless session bean can be as simple as

@Stateless
@Remote
public class HelloBean {
public String sayHello() {
return “Hello World!”;
}
}

Then there’s no home interface, remote interface, or deployment descriptor to code. Furthermore turning a stateless session bean into Web Service is so easy. Just annotate the bean with @WebService and the business methods (which you want to expose as Web Service operation) with @WebMethod. Annotations for Web Service are defined in JSR 181: Web Services Metadata for the Java Platform .

EJB 3.0 simplifies entity beans. The entity beans are also just POJOs with a few annotations. There’s no home interface, remote interface, or deployment descriptor to code. Annotations are used to specify transaction attributes, security permissions and annotated queries. Then there are some query language enhancements for entities like GROUP BY HAVING, bulk updates and deletes, JOIN operations.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply