This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Advantages of EJB  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one please tell me ,what are the main advantages of using EJB's over servlets or other technologies

Thnaks in Adance.
 
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In multi tier J2EE application,


JSP/Servlet - used in web tier. This is used for user interaction.

EJB - used in Business Tier or EJB Tier. This is used to interact with sensitive data and to build business processes.
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main advantages to EJB:

1. Transactions
2. Method level security
3. Concurrency control

The container handles all of this for you. Items 1 and 2 can be specified with XML declarations. It's really nice not to have to worry about multi-threaded code, transaction demarcation, and method level security.

Portablity between containers is also a plus, though it is not so seamless as one would like. As a minimum, you have to recompile the beans with the target vendor's EJB compiler.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!