• Post Reply Bookmark Topic Watch Topic
  • New Topic

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.
 
Don't touch me. And dont' touch this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!