• 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
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Very Basic Question in EJb

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may be very basic question but...
Definition of ejb bj ed-roman says that..
"An ejb ia a server-side software component that can be deployed in a distributed multitier environment"
Now servlets is also a server-side component then what;s the difference in ejb.
(I know that container provides services to ejb...transaction ,persistence, security....)
and what is mean by "can be deployed in a distributed multitier environment"
------------
prashant
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMO one major difference is the divergence from simple request/response semantics. Unlike Servlets(having a single point of entry), EJBs can expose business methods and hence they are true "business components".
And then you have inbuilt transaction support, instance pooling, lifecycle management and other such goodies...
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
methods can be invoked remotely on distributed environment which is not possible with servlets.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A very good question though it is a basic one. As others also pointed out EJBs are true distributed objects which has lots of facilities provided by the container where as a Servlet is just an entry point to the web container.
But I think what you are asking is, Why EJBs when Servlets are there ?. If this is your question you are talking about most commonly asked EJB question. For most of the applications (As far as I believe) EJBs are not needed or at least the use of EJBs cannot be justified(interms of money and complexity). But there are some applications which needs transactions management like services and for such projects use of EJBs can be justified.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a number of reasons EJBs might be useful in your architecture: They have the services of the container going for them: security, transactions, scalability, container managed persistence (arguably a good or a bad thing) etc. As mentioned before, they make meaningful methods available, not just "run this servlet". They can support CORBA, JMS and other protocols. I got all that today from the first day of a refresher EJB class.

Many of those requirements show up in high end systems only, and plenty of high capacity sites and apps have been built wihout em for sure.
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic