Oracle8i Enterprise JavaBeans Developer's Guide and Reference Release 3 (8.1.7) Part Number A83725-01 |
Library | Service | Contents | Index

## Implementing an EJB

There are four major components that you must create to develop a complete EJB:

- the home interface

- the remote interface

- the implementation of the remote interface--the actual bean class

- a deployment descriptor for each EJB

  Component | Description
  --- | ---
  The home interface | Specifies the interface to an object that the container itself implements: the home object. The home interface contains the `create()` methods that specify how a bean is created. The home interface, with the home object serves as a factory object for EJBs.
  The remote interface | Specifies the methods that you implement in the bean. These methods perform the business logic of the bean. The bean must also implement additional service methods that the EJB container calls at various times in the life cycle of a bean. See Basic Concepts for more information about these service methods.
  The bean implementation | Contains the Java code that implements the remote interface and the required container methods.
  The deployment descriptor | Specifies attributes of the bean for deployment and loading into the database. For example, the deployment descriptor declares the transactional properties of the bean. At deployment time, the EJB deployer, together with the application developer, can decide whether the container should manage transaction support or have the client do it.

The client application itself does not access the bean directly. Rather, the container generates a server-side object known as the EJBObject that serves as a server-side proxy for the bean. The EJBObject receives the messages from the client, and thus the container can interpose its own processing before the messages are sent to the bean implementation.

Figure 1-2 illustrates the interaction among these components.

#### Figure 1-2 Basic EJB Component Relationships

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index