Problem and Forces
- Application clients need to exchange data with
- Client invokes a business object's ( Session or
Entity EJB ) get methods
multiple times until it obtains all the attribute values
- Every call to an enterprise bean is potentially a
remote method call with
- The number of calls made by the client to the
enterprise bean impacts
network performance and so Application Performance.
Objects will be responsible for
- When the client requests the enterprise bean for the
business data, the
enterprise bean can construct the Transfer Object, populate it with its
attribute values, and pass it by value to the client.
- Allowing client to make a single remote
method invocation to the enterprise
bean to request the Transfer Object instead of numerous remote method
calls to get individual attribute values.
- Allowing client to invoke accessor (or getter)
methods on the Transfer
Object to get the individual attribute values from the Transfer Object.
- Class diagram representing the Session Facade pattern
- The sequence diagram that shows the interactions for
the Transfer Object
- Updatable Transfer Objects Strategy
- Where the BusinessObject is implemented
as a session bean.
- In this strategy, the Transfer Object not only
carries the values
from the BusinessObject to the client, but also can carry the
changes required by the client back to the business object.
- Entity Inherits Transfer Object Strategy
- Where BusinessObject is implemented as an entity
- The entity bean extends (or inherits from) the
class. The only assumption is that the entity bean and the
Transfer Object share the same attribute definitions.
- Simplifies Entity Bean and Remote Interface
- Transfers More Data in Fewer Remote Calls
- Reduces Network Traffic
- May Introduce Stale Transfer Objects
- Concurrent Access and Transactions
- Session Facade
- The Session Facade, frequently uses Transfer
Objects as an exchange
mechanism with participating entity beans. When the facade acts as a
proxy to the underlying business service, the Transfer Object obtained
the entity beans can be passed to the client.
- Transfer Object Assembler
- The Transfer Object Assembler is a pattern that
builds composite Transfer
Objects from different data sources..
- Value List Handler
- The Value List Handler is another pattern that
provides lists of Transfer
Objects constructed dynamically by accessing the persistent store at