EJB Architecture  «Prev  Next»

Lesson 12

EJB Architecture Conclusion

Distributed Object Architecture and Mechanisms

In this module, we covered the architecture of distributed objects.
We explored the concepts of remote objects that provide someservice to one or more clients. We explored how the request from the client is invoked through the use of a stub. The message is marshaled into a network-independent format and passed over the transport to the skeleton. The skeleton un-marshals the request and invokes the appropriate method of the remote object.

  1. Remote object: An object that provides a service through its methods and is located on another host on the network. The location of the object needs to be known before its methods can be called.
  2. Service: To be useful, a remote object must perform some useful function. This function is know as the ""service"" it provides.
  3. Stub: The object that the client uses to make requests of a remote object
  4. Marshal: The translation of a method call with its parameters into a wire format suitable for transmission of a network transport.
  5. Skeleton: The object that listens on the network for requests to a specific remote object from a client, then invokes those methods and returns any return value back to the client.
  6. Marshal: The translation of a method call with its parameters into a wire format suitable for transmission of a network transport. See un-marshalling.


EJB Components

We talked about the notion of a component[1] that provides a service through one or more interfaces[2]
This allows its implementation ( realization[3] ) to be replaced without the client being aware of the change.

Business logic versus "plumbing"

I explained to you how, by using an object monitor that manages the remote object, we can separate the business logic and the plumbing. A programmer no longer has to be an expert in more than one discipline. The remote object lives inside a container that manages its transactions, security, lifecycle, persistence, concurrency, multi-threading, etc. The server connects the container to the network transports. A name service provides the client with a way to lookup the remote object and to download the stub.

  1. Object monitor: The combination of remote object together with the environment that manages it and that allows method calls to the remote object.
  2. Container : That part of a object monitor that manages the remote object and provides system services.
  3. Transaction: A transaction is a unit of work that comprises some input request, the processing of that request and the return of a response to the request.
  4. Security: In this course security relates to client access to a remote object only.
  5. Lifecycle: The states that an object can be in from its birth to its death.
  6. Persistence: Objects whose state lives beyond the lifetime of the object are known as persistent. The state is usually stored in a database.
  7. Concurrency: In multi-threaded systems, an object that could have one or more threads executing its methods and changing its state at the same time is said to be concurrent and to exhibit concurrency.
  8. Server: That part of a object monitor that handles networking and distributed services.
  9. Lookup: The looking up of a service provided by the remote object in a name service.

EJB Transactions

I illustrated that a transaction is an atomic unit of work that is either completely executed or not at all. A transaction is started with a begin transaction, committed with a commit transaction, and rolled back with a rollback.
  1. Atomic unit of work: A number of steps that must all be executed or none of them executed.
  2. Begin transaction: Start a transaction. All steps that follow until either commit or rollback will be treated as an atomic unit of work.
  3. Commit transaction: Make the changes requested in the steps since the begin transaction permanent.
  4. Rollback transaction: Undo any changes requested in the steps since the begin transaction.

EJB Deployment

Before a remote object can be accessed it must be deployed[4] in an object monitor and its local runtime settings declared.

In the next module, we will look at the architecture of Enterprise JavaBeans.

[1]Component: A physical and replaceable part of a system that conforms to and provides a realization of a set of interfaces.
[2]Interface: The public methods of an object that provide some useful service.
[3]Realization: The concrete implementation of one or more interfaces.
[4]Deploy: Add a remote object to an Object Monitor so that it is available to clients.