March 30, 2010 at 12:56 PM
1)Java Beans are used for building extendable components and contain getters and setters for all its data members, along with other required functionality while EJBs are server side programs that typically implement middle layer business functionality.
2)JavaBean is standalone and works only in the same JVM while EJB is designed to work in distributed environment using rmi/iiop protocol.
3)There is no explicit support exists for transactions in javaBeans while EJB's may be transactional and the EJB servers provide transactional support.
4)JavaBeans may have BeanInfo classes,property editors or
customizers while EJB's have no concept of BeanInfo classes,property editors or customizers and provide no additional information other than that described inthe deployment descriptor.
5)JavaBeans are intended to be local to a single process
and are primarly intended to run on the client side. Although one can develop server-side JavaBeans,it is far easier to develop them using the EJB specification instead.