This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Advantages of EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Advantages of EJB" Watch "Advantages of EJB" New topic
Author

Advantages of EJB

san yee
Greenhorn

Joined: Dec 21, 2006
Posts: 5
Can any one please tell me ,what are the main advantages of using EJB's over servlets or other technologies

Thnaks in Adance.
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

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.


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Neerav Narielwala
Ranch Hand

Joined: Dec 08, 2006
Posts: 106
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.


<a href="http://www.java-tips.org/java-tutorials/tutorials/" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="http://www.planet-java.org" target="_blank" rel="nofollow">Java Weblog</a> | <a href="http://computer-engineering.science-tips.org" target="_blank" rel="nofollow">Computing Articles</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advantages of EJB
 
Similar Threads
what are the advantages of struts
Advantages of Applet
Locking: how much is enough?
Advantages of Nesting Interfaces ?
TC6 or Glassfish2.0 for production?