Switch to full style
What's behind JSP & Servlets
Post a reply

What is Enterprise JAVABEANS? !!

Thu Jun 28, 2007 11:08 pm

What is Enterprise JAVA-BEANS? !!
--------------------------------------------------


Enterprise JavaBeans provide the mechanism and architecture for component based distributed architecture. Enterprise JavaBeans are components that may be "plugged in" to a server which enable extending a Server's functionality. An EJB component is a Java class, written by an EJB developer, that implements business logic. An Enterprise JavaBean is a component, just like a traditional JavaBean. Enterprise JavaBeans execute within an EJB container, which in turn executes within an EJB server. Any server that can host an EJB container and provide it with the necessary services can be an EJB server.

Client programs execute methods on remote EJBs by way of an EJB object. The EJB object implements the "remote interface" of the EJB component on the server. The remote interface represents the "business" methods of the EJB component. The remote interface does the actual, useful work of an EJB object, such as creating an order form or entering a remote bank transaction into the database.

You can create a analogy of a EJB component and object with a VCR and its remote control. VCR is an EJB component and the EJB object is analogous to your remote control: both the VCR and the remote control have the same buttons on the front, but they perform different functions. Pushing the Forward button on your VCR's remote control is equivalent to pushing the Forward button on the VCR itself, even though it's the VCR -- and not the remote -- that actually forwards a tape.

When a developer designs a new EJB component, writing the code that makes up the enterprise bean class is not enough in itself. The EJB programmer must also write two Java interfaces that will be used by helper classes. These mandatory interfaces must extend the standard EJBObject and EJBHome interfaces, which are extensions of the java.rmi.Remote marker interface. The interface that extends the standard EJBObject interface, referred to as the enterprise bean's remote interface, specifies the business methods that are defined in the bean itself. When an application invokes a business method on an enterprise bean, the application does not access the bean itself. The method invocation is actually routed to the object that implements the extension of the EJBObject interface. This practice is referred to as delegation, and is a design point in the EJB architecture:
Similarly, call the addEmployee() method on an EJB object, and it calls (indirectly, through the network) the addEmployee() method on the remote EJB component. The EJB component model is thus a very powerful model for building enterprise applications and is the focal point of the Java 2, Enterprise Edition (J2EE) architecture.



Post a reply
  Related Posts  to : What is Enterprise JAVABEANS? !!
 What is JAVABEANS? !!!     -  
 What is javaBeans     -  
 Enterprise Application Integration     -