!--a11y-->
Introduction to Enterprise Beans 
SAP J2EE Engine implements Enterprise JavaBeans™ (EJB™) architecture – part of the Java™ 2 Platform, Enterprise Edition – which is a component architecture for creating scalable, multi-tier, distributed applications.
Enterprise JavaBeans™ is a technology for developing, assembling, deploying, and managing distributed applications in an enterprise environment. It simplifies the handling of issues inherent in distributed applications. By concealing such complexities as security, transaction handling, and database access, SAP J2EE Engine EJB architecture enables component developers to focus on business logic.
Enterprise JavaBeans™ applications are platform independent. Once developed, enterprise beans can be deployed on multiple platforms without recompilation or source code modification.
The Enterprise JavaBeans™ architecture is compatible with, and uses, other Java programming language APIs. Enterprise beans can interoperate with non-Java programming language applications and are compatible with the CORBA protocols.
Enterprise beans are components created with a set of characteristics to do their own specific job, and they have the ability to take on other characteristics from the container on the server in which they reside.
The beans are components that have interfaces in them so they can be used by and integrated with other beans that were developed by different bean providers at different times. A bean can be built and tied together with other beans later at assemble time. This provides a way of building something and using it again later; that is, the notion of a component. This means that the beans are platform-independent. Once a bean is written, it can be used on any platform that supports Java.
The difference from pure objects is that beans have an external interface, which enables a tool to read what the component is supposed to do, and hook it up to other beans and plug it into another environment.
Enterprise beans provide the functions that are required by an enterprise application (such as, accessibility, lifecycle management, transaction management, and security), thereby moving the business and data manipulation logic to the second-tier server. In this way, the applications take advantage of the power of high-end, multithreaded, and multiprocessing systems as server components, such as enterprise beans, to pool and share scarce resources.
Enterprise beans are remotely or locally executable components or business objects deployed on the server. Their protocol enables them to be accessed both remotely and locally depending on the application’s requirements, and to be installed or deployed on a particular server. They have a set of mechanisms that enables them to delegate major qualities of service, security, transactional behavior, concurrency (the ability to be accessed by more than one client at a time), and persistence (how their state can be saved) to the container in which they are placed on the EJB server. They get their behavior from being installed in a container.
There are three types of enterprise beans – session beans, entity beans and message-driven beans – representing different types of business logic abstractions.
Session beans represent behavior associated with client sessions. Typically, they are implemented to perform a sequence of business operations. A session bean is a logical extension of the client program, running processes on the client’s behalf remotely on the server. Session beans are typically accessed remotely and they typically access entity or other session beans locally.
For more information, see Developing Session Beans.
Entity beans represent specific data or collections of data, such as a row in a relational database. Entity bean methods provide operations that act on the data represented by the bean. The data that an entity bean represents is persistent; therefore entity beans survive as long as their data remains in the database – that is, they survive server crashes. Entity beans can have bean-managed or container-managed persistence. Entity beans are recommended to provide local view, as they are not accessed directly by the clients. Moreover, the local view speeds up the EJB application performance.
For more information, see Developing Entity Beans.
Message-driven beans provide the integration between the EJB architecture and JMS. Message-driven beans serve as an asynchronous JMS message consumer and implement some business logic. They run on the server side and are invisible to the clients, stateless, and all their instances are equivalent. In contrast to session beans and entity beans, they do not provide home and component interfaces.
For more information, see Developing Message-Driven Beans.
SAP J2EE Engine EJB architecture fully implements Enterprise JavaBeans™ Specification, v.2.0 from Sun™ Microsystems and is compliant with Enterprise JavaBeans™ Specification, v.1.0 and Enterprise JavaBeans™ Specification, v.1.1. That is, all enterprise beans developed according to previous releases of the Enterprise JavaBeans™ Specification will run on SAP J2EE Engine. However, when you develop new EJB applications, we recommend that you use the Enterprise JavaBeans™ Specification, v.2.0 release, as it provides enhanced and improved functions.
