Enterprise JavaBeans

Enterprise JavaBeans (EJB)is a standard server-side component model for component transaction monitors. EJB is based on distributed object technologies, foundation for modern three-tier architectures. In a three tier architecture, the presentation logic is the first tier which resides on the clinet, the business logic is the second or middle tier and other resources like database is the third tier.

Distributed object protocols are designed to make an object on one computer look like it is residing on a different computer. Business objects, the skeleton, and the stub are the three parts in this architecture. Business object which resides on the middle tier is an instance of an object that models the state and business logic of some real world concept. Every business class has matching stub and skeleton classes built specifically for that type of business object. The stub and skeleton are responsible for making the business object on the middle tier look as if it is running locally on the client machine. Every instance of business object on the middle tier is wrapped by an instance of its matching skeleton class. The stub acts as the business object's surrogate on the client and is responsible for communicating requests from the client to the business object through the skeleton.

The remote method invocation (RMI) protocol is used to communicate method invocations over a network. The stub and skeleton hide the communication specifics of the RMI protocol from the client and the implementation class.

The business object implements a public interface that declares its business methods. The stub implemets the same interface as the business object with logic to forward the request to the business object and receive the results. When a client invokes a business method on the stub, the method name and parameters are passed to the skeleton. The skeleton invokes the method and return the results to the stub. The stub returns the value to the client application as if it had processed the business logic locally.

EJB is designed for interprocess components and used to manage distibuted business objects in a three-tier architecture. EJB uses a set of classes and interfaces from the javax.ejb package. Developers can create, assemble, and deploy components using this package.

EJB 2.0 supports advanced asynchronous messaging also. It allows two or more applications to exchange information in the form of messsages. These messages inform an application of some event or occurrence in another system. Messages are transmitted form one application to another on a network using message-oriented middleware (MOM). MOM provides proper delivery mechanisms, fault tolerance, load balancing, scalability and transactional support to reliabley exchange large quantities of messages.

About Us | Contact Us | Disclaimer | Privacy Policy | ©2008 thewebguru.com