Distributed Objects   «Prev  Next»

Lesson 10 Enterprise JavaBeans Conclusion
Objective Material that was covered in this module.

Distributed Objects Conclusion

EJB architecture maps directly onto an Object Monitor

In this module we have described in some detail the different parts of Enterprise JavaBeans.
In the first lesson we saw that the EJB architecture maps pretty directly onto the Object Monitor.
The next lesson explained that there is no similarity between a Java Bean and an Enterprise JavaBean, except the name and that they are both components.
The EJB architecture was mapped to the Object Monitors, and I explained how the container interposes itself between the client and the bean which allows for security checking, starting transactions, etc. without the bean knowing anything about it.
We looked next at the services that the container provides the client and the EJB.

From the general to the specific, I introduced both stateful and stateless session beans and showed how their instances are created by the container at the request of the client. From that point, the instances have a one-to-one relationship with the client until either the server crashes or the client removes the instance. Entity beans came next, and I explained that they are components that map to a specific, identifiable piece of data, such a customer row in a database.
We examined the deployment descriptor and the jar file in which it is packaged together with its bean for uniform distribution. I briefly discussed the different roles that developers can play in the process of developing beans, building them into applications, deploying, and executing them.

  1. Stateful: The property of an object such that it contains information that is maintained across method calls.
  2. Stateless: The property of an object such that it contains no information that needs to be preserved across method calls.
  3. Entity bean:An EJB that is an object representation of a piece of persistent data.
  4. Deployment descriptor: Information that describes both the structure of an Enterprise Java Bean, and the information required by it at runtime.
  5. Jar file: A file created with the Java jar program which is similar to tar on the Unix platform.

Discussion

The decision to use EJBs as compared to a more conventional solution depends on the type of problem you are trying to solve. Some problems are suitable for EJBs and others are not. Spend a little time thinking about opportunities for using EJBs in your environment and identify a few potential beans.
  1. Would they be session or entity beans?
  2. Stateful or stateless?
  3. Small or large granularity?
  4. What applications do not lend themselves to EJBs?
In addition, think about some of the design and performance issues that you may have to deal with when using EJBs.
In the next module, the programming of session beans will be discussed.