Win a copy of Fixing your Scrum this week in the Agile 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

EJB AND other technologies

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all

I am new to EJB and had a basic doubt! what is the point in using stateful session beans when the same can be achieved by using a cookie or a session is jsp .

similarly all the session beans have an altenative.
In fact the entity beans can also be avoided & other technologies like hibernate, and other DAO's can be replaced.

Can anyone tell me the main reason & the situation where EJB's can be used.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of EJB is certainly optional. Sun's goal was to provide container services to automate a lot of drudge work so developers could focus on the business. It's open for debate whether they made things so complicated that they missed the goal entirely.

I don't know of anyone using stateful session beans. It's a pretty neat idea but has never seemed worth the effort to me. Anybody?

More people abandon container managed entity beans every day, I think. There are plenty of alternatives. The next EJB standard version has a persistence layer that is very similar to Hibernate.

Still the EJB container does provide a nice set of services in transaction management, security, remote access and so on. You'd have to look at the full set of features, think about how much work it would be to roll your own and then decide if you want to be in an EJB container or not.

I've worked on two systems that had a single stateless session bean gateway to all functionality. Everything else was written in POJOs with minimal references to EJB services. Those architectures chose to use the transaction and security and such, but most of the time the coders were completely unaware of EJBs. With a good measure of dependency injection (ala Spring or something like it) you can build POJOs that can run outside the container for testing or even reuse in a non-EJB project.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can anyone tell me the main reason & the situation where EJB's can be used.


I tend to reply to this sort of question with three words.

Distribution
Transactions
Messaging

[Removed text that could be interpretted incorrectly. Mark ]
[ January 24, 2006: Message edited by: Mark Spritzler ]
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic