Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between EJB and Java bean ?

 
siva chaitanya
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.
 
harshvardhan ojha
Ranch Hand
Posts: 157
1
Android Java MySQL Database
  • 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 Java MySQL Database
  • 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.
 
Lucas Smith
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic