Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

difference between EJB and Java bean ?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as i know java bean has private member variable, getters and setter methods used to map the input parameters with the fields in the database and EJB is a server side component has some business service methods and these methods called from the client side. Correct me if i am wrong and please tell me the exact difference.
 
Ranch Hand
Posts: 157
1
Android MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi siva, yes what you have written is correct. Beans are standard pojos in java while ejb is a business component which has server level support for functions like security, session management and transaction. In fact nothing is common.
 
siva chaitanya
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi harshvardhan thank you for your reply can you please give me some real time example of EJB and what is the use of exposing the business methods through EJB
 
harshvardhan ojha
Ranch Hand
Posts: 157
1
Android MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi siva, while writing any business logic, you need to have a controlled environment, and you need to manage a lot of things. So here you have ejb compliant servers.
So you don't need to manage all the system level services, which are already being managed by application servers like transactions,security,life cycle ,threading,persistence etc.

No one framework or component can resolve all business problem, so once you will learn EJB you will understand when to choose it and also you are going to appreciate the way it works.
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBs are magic things. With simple @Stateless annotation you have a managed, transactional component that is monitored by application server. JavaBeans and EnterpriseJavaBeans have rather little in common.
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic