This guide helps you learn the new EJB3 through a series of examples. It also helps you install JBoss with EJB3, so you are ready to try the examples.
* [JBoss EJB 3.0 and Extensions: TrailBlazer][1]
[1]: http://trailblazer.demo.jboss.com/EJB3Trail/
This guide helps you learn the new EJB3 through a series of examples. It also helps you install JBoss with EJB3, so you are ready to try the examples.
* [JBoss EJB 3.0 and Extensions: TrailBlazer][1]
[1]: http://trailblazer.demo.jboss.com/EJB3Trail/
It is done! FriFinans has been rewritten, using the new EJB3. I guess that from now on, it will be much easier to add/change functionality. It will also be a lot easier for new developers to start coding, because of the new, slick model.
Just take a look at this little example:
* [Account Entity in EJB2 (old)][1]
* [Account Stateless Bean in EJB2 (old)][2]
* [Account Entity in EJB3 (new)][3]
* [Account Stateless Bean in EJB3 (new)][4]
[1]: http://cvs.frifinans.dk/frifinans/src/org/frifinans/server/model/Attic/LedgerAccountBean.java?rev=1.9&view=auto
[2]: http://cvs.frifinans.dk/frifinans/src/org/frifinans/server/function/Attic/AccountBean.java?rev=1.20&view=auto
[3]: http://cvs.frifinans.dk/frifinans/src/org/frifinans/server/entity/LedgerAccount.java?view=markup
[4]: http://cvs.frifinans.dk/frifinans/src/org/frifinans/server/stateless/AccountBean.java?view=markup
After having tried EJB3, I’m convinced that this is the right thing for the FriFinans project.
I think there are many problems with the old EJB2 model.
Some of the bad things about the EJB2 model:
* Not really JavaBeans we are working with. IMO: Not really OO!
* “FileHell”. To create an entity you’d have to create up to 7 files!!!
* XDoclet solved the “FileHell”, but created a more vendorlocked model,
where EJB Container-bindings and datasource-bindings are “inside!!!” the bean.
These issues are solved in EJB3:
* We are working with real POJO’s (Plain Old Java Objects).
* To create an entity, you create One entity bean class. Thats it! No more, no less.
* Vendor independent. Very easy to change DB or EJB Container.
The only minus about EJB3, which I have found so far, is that when you are creating SessionBeans (stateless/stateful), you have to create up to 2 interfaces. One for Remote and one for Local (if needed). I don’t understand why this couldn’t be just one file, which you could choose to expose to Remote or Local. But then again: I’m not completely in to this new EJB3 model, so maybe I’ve not just seen the purpose of this design…
Lately I have considered using EJB3 for FriFinans. EJB3 gives a much more clean server code. Take a look at [this article][EJB3], which discusses the new EJB3 model.
I think I will give it a try and post again when I have concluded what to do.
* [JBoss impementation of EJB3][JBossEJB3]
* [EJB3 specification][EJBSpec]
[EJB3]: http://www.jroller.com/comments/raghukodali/Weblog/does_ejb_3_0_really
[JBossEJB3]: http://www.jboss.org/products/ejb3
[EJBSpec]: http://java.sun.com/products/ejb/docs.html
Today I received a call from someone, who would like to hire me as a J2EE programmer.
But as I allready have the job-of-my-dreams I had to decline.