ValueObject
| Kind of class: | public interface |
|---|---|
| Package: | com.bourre.events |
| Inherits from: | none |
| Implemented by: | |
| Author: | Francis Bourre |
| Classpath: | com.bourre.events.ValueObject |
| File last modified: | Monday, 14 January 2008, 14:56:25 |
accessed together. Accessing these attributes in a fine-grained
manner through a remote interface causes network traffic and high
latency, and consumes server resources unnecessarily.
A value object (also known as transfer object) is a serializable
class that groups related attributes, forming a composite value.
This class is used as the return type of a remote business method.
Clients receive instances of this class by calling coarse-grained
business methods, and then locally access the fine-grained values
within the value object. Fetching multiple values in one server
roundtrip decreases network traffic and minimizes latency and
server resource usage.
When a web-service uses a Value Object, the client makes
a single remote method invocation to the web-service to request
the Value Object instead of numerous remote method calls to get
individual attribute values. The web-service then constructs
a new Value Object instance, copies values into the object
and returns it to the client. The client receives the Value Object
and can then invoke accessor (or getter) methods on the Value Object
to get the individual attribute values from the Transfer Object.
Or, the implementation of the Value Object may be such that it makes
all attributes public. Because the Value Object is passed by value
to the client, all calls to the Value Object instance are local
calls instead of remote method invocations.