IIRC an EJB is an Enhanced Java Bean? In a nutshell, how does an EJB differ from a Java Bean? A bean is pretty much just the getters and setters for fields off of an html form correct? Does an EJB contain more program logic? Regards, Aaron R>
Strictly a JavaBean is a component designed for GUI programming. The term predates J2EE and specifies a self-contained software component, i.e. it will contain both properties and methods to publish changes in those properties (typically event driven and using introspection). The term has been co-opted in the J2EE world to basically mean a class which represents some data - it has accessor and mutator methods which would be used by (for example) JSP to disply the data in a web application. So you are right, it is pretty much "the getters and setters for fields off of an html form" An Enterprise Java Bean is a completely different type of component. The key difference with any other Java class is it they are designed to work in a distributed, multi-user environment. EJBs can only exist within an EJB container (Weblogic, Websphere, JBoss etc.), and they provide certain behaviour that is usually required for this type of software component: transaction management, (implicit) thread management, declaritive security, clustering etc. Have a look at the J2EE tutorial on Sun's site for an introduction.