• Post Reply Bookmark Topic Watch Topic
  • New Topic

similarity between ejb 2.0 and ejb 3.0  RSS feed

 
amit taneja
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
can any body please tell me, how much is the similarity in contents in ejb 2.0 and ejb 3.0, I just used ejb 3.0 in my project (initial level, i.e stateless session beans with annotation and I DON'T have any any idea of ejb 2.1 )

so what is the thing that doesn't change at (from programming point of view)
i think following are the thing that doesn't get change
1.Transactions
2.Exception
3.Security Management

please add your valuable comments and please correct me if I am wrong.

thanks
 
Jon Wetherbee
author
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amit-
Actually, if you are using annotations with EJB 3.0 (note that you can use either annotations or ejb-jar.xml) the things you mention *would* change.

* Transactions
If you prefer annotations (and many people do), you could specify transaction attributes for the bean, or for any specific method, using the @TransactionAttribute annotation.

* Exceptions
In EJB 3.0, you no longer need to throw java.rmi.RemoteException from methods declared on your remote interface.

*Security
Security roles and method permissions also may be specified using annotations.

The main thing that *doesn't* change is the actual business logic in your business methods. If you accept the default transaction and security settings for your session bean, all you are left with to code is a simple class that is annotated @Stateless or @Stateful and contains ordinary methods for your business logic.

Looking beyond the defaults goes beyond the scope of this reply, but there is much written on the topic.

Regards,
Jon

http://www.amazon.com/Beginning-EJB-Application-Development-Professional/dp/1590596714/sr=11-1/qid=1162493716/ref=sr_11_1/002-0255731-2231223
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!