• 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

Why EJBs?

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBs are getting ridiculously complex and one cannot master them just by reading books or taking exam or attempting certain examples. Even if one is working with EJBs at work, it takes months to get a certain level of comfort.

So why use EJBs? Why not use SQLJ, JDO or even simple plain JDBC?

Regards,
Saeed Amer
[ July 26, 2005: Message edited by: Saeed Amer ]
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is because EJB containers provide more functionalities than those technologies you had specified. For example, in case there is an exception involved a series of DB operations, if one of them has been failed, the whole transaction should be rollback. Then, you have to code for handling such events. For EJB, containers will cater all stuffs for you.

Although it is very complex, EJB 3.0 has tried to simplify EJB via POJO and make use of the idea of Hibernate. Let's see the improvement of the new EJB generation.

Nick
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Saeed,

You get infrastructure services such as transactions, pooling, security, and so on from EJB containers. You can focus on business functionality.

Thanks,
Siripa
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd say the primary reason for using EJB is to get the distributed transactions. EJB is certainly not suitable for every situation (as is well-documented).
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be interesting.
https://coderanch.com/t/316680/EJB-JEE/java/EJB-vs-Spring
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Barend Garvelink:
I'd say the primary reason for using EJB is to get the distributed transactions. EJB is certainly not suitable for every situation (as is well-documented).



For distributed transactions you have JTA and EJBs use it internally.

Spring provide some features, like declarative transaction through AOP that can use JTA too if you need.

As this thread is about "Why EJB's?" I'm mentioning Spring as a good alternative/complement that can be used in many projects.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

As this thread is about "Why EJB's?" I'm mentioning Spring as a good alternative/complement that can be used in many projects.


In certain sense, if any opensource framework looks good to J2EE, I guess SUN will try to adopt their features in the upcoming versions, like EJB 3.0 adopts the ideas from Hibernate.

So, don't worried too much, J2EE framework will be more and more mature.

Nick
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic