Lesson 1
Distributed Applications, Components and Remote Objects
In order that you fully understand how to write Enterprise JavaBeans (EJBs), it is important that you understand where they reside.
In this module, I will create a map of the world in which distributed objects and constructors provide useful services to client programs.
This introduction will let you find your way within the technology that is introduced in the rest of the course.
Understanding the Territory
I will explain how a client program communicates with a remote object , and how it makes use of the services it provides.
I will identify the properties of a reusable component, and describe how they can be connected together so that you can build flexible applications. I will explain the function of servers, containers, and Object Monitors (OMs). You will be introduced to transactions within this world of distributed objects.
You will learn about the deployment of remote objects and how they get information about local resources , such as the names of the local databases. Carefully read this section in preparation for the tutorial on Enterprise Java Beans.The information in this section is the foundation for all that follows.
Object Components
- Message: Another name for a method call. Conveys the idea that the method call is invoked across a network.
- Distributed object: An object somewhere on the network that provides some service that is known and available to clients.
- constructor:A pseudo-method that creates an object.
- Remote object: An object that provides a service through its methods and is located on another host on the network. The location ofthe object needs to be known before its methods can be called.
- Component: A physical and replaceable part of a system that conforms to and provides a realization of a set of interfaces.
- Object monitor: The combination of remote object together with the environment that manages it and that allows method calls to the remote object.
- Local resource: A resource, such as a database connection, that is accessible without traversing the network.
In the next lesson, clients and remote objects will be introduced.
Services provided by Containers
There are also some potential value-adds that a container may provide, possibly separately from its core model:
- Enterprise services: Providing transaction management or other declarative services to objects running in the container. These may be declarative.
- Thread management: A container may offer a threading model for access to managed objects.
- Object pooling: A container may provide instance pooling for managed objects.
- Clustering: A container may itself provide clustering support, in which clients can transparently communicate with peer containers, as with EJB clustering. Note that this is often unnecessary when using clustering support at whole application deployment level, in which all application components are deployed on each machine. Container-level clustering is necessary to support a stateful component model such as stateful session beans, but is less important when managed objects are stateless.
- Management: A container may provide management services for objects running within it, such as a management console or possibly management via JMX.
- Remoting: This can be divided into two services. Today there are multiple potential wire protocols, with no clear winner (although SOAP-based web services seem to be growing in popularity).
- Exposing remote services: Providing remote access to objects running in the container. This model is demonstrated by remote EJBs, an excellent remoting technology where RMI/IIOP is concerned.
- Consuming remote services: Providing transparent access to remote objects running outside the container.
- Customization and extensibility: Allowing custom services to be applied to objects running in the container: for example, custom declarative services such as special security checks.