JavaPolis 2005 – EJB 3.0

Aino Andriessen
0 0
Read Time:1 Minute, 15 Second

While EJB 3.0 persistence gains a lot of attention we should not forget that EJB is more than persistence but also contains session beans and messaging driven beans. Mike Keith and Linda DeMichiel gave an excellent overview of the changes and improvements we can expect on these EJB’s. They explained that the driving force of EJB 3.0 is ‘ease-of-development’. While the current EJB’s are very powerfull they are also quite complex. Based upon Java metadata (annotations), dependency injection and on default, standard, usage we’ll get rid of the EBJ interfaces, the deployment descriptor and of the SessionContext in the code. This makes EJB’s much more like real POJO’s which results in cleaner, more comprehensible and better testable code.

 

For example:

import javax.ejb.Stateless.*;
/**
* A simple stateless session bean implementing the incrementValue() method of the
* CalculateEJB interface.
*/
@Stateless(name="CalculateEJB")
public class CalculateEJBBean implements CalculateEJB {
int value = 0;
public String incrementValue() {
value++;
return "value incremented by 1";
}
}

Other improvements are the Enhanced Lifecycle Methods and Call Back Listeners: Instead of implementing the unnecessary callback methods like ejbActivate, ejbPassivate etc. any method can be designated to receive notifications for life cycle events. Another addition are Interceptors that are designed to intercepts a business method invocation.
EJB 3.0 will be backwards compatible and will support incremental migration.

Although the production release will be ready only until JavaOne, many vendors are already offering EJB 3.0 implementations.

More info:

About Post Author

Aino Andriessen

Aino Andriessen is principal consultant and expertise lead 'Continuous Delivery'. His focus is on Oracle Fusion Middleware ADF and SOA development, Continuous Delivery, architecture, improving the software development proces and quality management. He is a frequent presenter at Oracle Open World, ODTUG Kaleidoscope, UKOUG Technology Conference and OUGN Vårseminar. He writes articles and publishes at the AMIS technology blog (http://technology.amis.nl/blog/).
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Next Post

Three interesting announcements - EJB 3.0, Eclipse WTP and a new database: H2 (source included, Java)

Just browsing through my RSS feeds-reader, I stumbled across three very interesting announcements: JSR-220, the Enterprise JavaBean 3.0 specification, has reached Proposed Final Draft status. Programmers should expect that implementations should start to solidify now, although minor changes can still occur. It was predicted by Mike Keith in his presentation […]
%d bloggers like this: