Use the Transfer Object pattern to minimize network traffic by providing a local representation of a fine-grained remote component (usually an entity).
Transfer Object functions
Provides a local representation of a remote entity (i.e., an object that maintains some data state).
Minimizes network traffic.
Can follow Java bean conventions so that it can be easily accessed by other objects.
Implemented as a serializable object so that it can move across the network.
Typically easily accessible by view components.
Transfer Object principles
The Transfer Object is based on:
reducing network traffic
Minimizes the performance impact on the web tier when remote components’ data is accessed with fine-grained calls.
Reduces coupling between tiers.
A drawback is that components accessing the Transfer Object can receive out-of-date data, because the Transfer Object’s data is really representing state that’s stored somewhere else.
Making updatable Transfer Objects concurrency-safe is typically complex.