• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diffrence between javabeans and ejb

 
Dharmender Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybdy tell me that what is the diffrence between javabeans and ejb and can we run the javabeans in ejb container

thanks in advance,
dharmender singh
 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Beans are basically data containers. Simple class with private or protected member variables and getters and setters for each of them. Usually a no-arg constructor is required as well. These components are used to transfer data from one component to another.

While Enterprise Java Beans are distributed server-side components, which must be run in an EJB container. This is one difference - JB can be run anywhere, but EJB only in the server JVM. Whatsmore, EJB come in three flavours - Session for performing business logic, Entity for persistence (nowadays it's called JPA) and Message driven for messaging.

This should be enough for knowing the difference, if you'd like any specific details, don't hesitate to ask.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More discussion on this subject can be found at JavaBeansAndEnterpriseJavaBeans.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best advice I can give you this: Just because their names are similar, don't assume they are in anyway related.

Its like someone saying that Javascript is the same as Java. Bad use of naming. EJBs are heavy-weight modules that require specialized J2EE servers whereas java beans can be made out of almost any class with very little overhead. Just ignore the overused naming and consider them distant relatives.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic