Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resources to learn EJB [closed]

I am gonna start learning EJB. I just need your suggestion on picking the version for learning EJB 2.0 or EJB 3.0. Is it good idea to start with EJB 2.0 and migrate to EJB 3.0? If it is, can it be easy to migrate? Actually I am holding Head First EJB book covering version 2.0. Suggest me any other good book, that I can stick to it for complete learning of EJB.

I am very grateful to you if you help me in becoming EJB Guru

like image 920
Pokuri Avatar asked Dec 03 '22 06:12

Pokuri


2 Answers

I'd strongly recommend learning EJB 3.0 vs. EJB 2.0. It follows similar patterns to the popular ORM Hibernate. I don't believe there's much value in learning an earlier variant of EJB, when the current version follows commonly used ORM patterns and is supposed to be much simpler. From the FAQ:

The goal of EJB 3.0 is to target ease of development, the main theme of the Java EE 5 platform release. EJB 3.0 is a major simplification over the APIs defined by the EJB 2.1 and earlier specifications. The simplified EJB 3.0 API allows developers to program EJB components as ordinary Java objects with ordinary Java business interfaces rather than as heavy weight components. Both component and client code are simplified, and the same tasks can be accomplished in a simpler way, with fewer lines of code. Because it is much simpler, EJB 3.0 is also much faster to learn to use than EJB 2.1.

Since the two versions are so different, migration is next to impossible beyond the most basic concepts. Unless you have a specific requirement such that you need to look at EJB 2.0, check out the latest variant.

like image 157
Brian Agnew Avatar answered Dec 11 '22 16:12

Brian Agnew


You definitely want to learn EJB 3.0 over 2.x. The programming model was substantially improved and simplified. Richard Monson-Haefel's Enterprise JavaBeans 3.0 (Fifth Edition) is pretty highly regarded.

Scott Leberknight blogged about his shock at how difficult it was to go back from EJB 3.0 to legacy EJB 2.1 code.

But @Nathan Feger brings up a good point. Many are moving from EJB to other approaches, both Java EE and non-Java EE based. Even Richard Monson-Haefel now thinks they're in decline. Another indicator cited to support this position is that the Spring Framework recently overtook EJB on job site indeed.com and is now seemingly twice as desirable. There was a lot of pushback from Java EE defenders when RMH's podcast came out though, so you should study both sides of this issue and decide for yourself where to focus your personal development efforts.

like image 26
Jim Ferrans Avatar answered Dec 11 '22 15:12

Jim Ferrans