• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

similarity between ejb 2.0 and ejb 3.0

 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic