Session beans have the following features:
· They are associated with and represent a single client on the server-side
· They are usually remotely accessible
· They usually access entity beans locally
The local view was introduced with EJB Specification v.2.0, therefore beans developed according to the 1.1 version do not provide a local view.
You can develop session beans when:
· You have to develop a set of functions that will be used many times by a variety of clients.
· You want to develop coarse-grained business objects.
· The client-bean session does not need to be persistent and the bean does not have to store information for the client.
Session bean instances exist and may hold data as long as the client session exists. Afterwards they are removed and the data is not preserved.
· The session beans will serve as a facade (the so called session facade) in front of the entity beans (which will represent the persistent data).
The process of developing a session bean consists of the following steps:
...
1. Choose whether to use Stateful or Stateless Session Beans.
2. Create the session bean using the NetWeaver Developer Studio (see Creating Stateless Session Beans or Creating Stateful Session Beans).
3. Develop the source code of the session bean. This includes developing:
...
a. The component interface(s)
b. The home interface(s)
c. The bean class
d. Any helper classes required by the session bean
4. Create and edit the bean’s deployment descriptors.
5. Compile and pack all EJB components in a JAR file.
6. Pack the whole application in an EAR file.
7. Deploy the application on the J2EE Engine.
8. Start the application.