Monday, February 22, 2010

J2EE Design Patterns - Transfer Object / Value Object

If the client needs to display set of attribute on the server. The client application calls the individual getter and setter methods that require single attribute values. This will cause a huge network traffic block.

People come across new design pattern to overcome this issue. That Pattern is called as Transfer Object/Value Object Design Pattern.

Here Transfer Object encapsulates the bulk business data. A single method call is used to send and retrieve the Transfer Object / Value Objects.

This Pattern has three main components

They are,

Client - client can be GUI interface

Business Object – can be Entity Bean, Session Bean or Data Access Object .Also responsible for creating Transaction object.

Transfer Object - an arbitrary serializable Java object. The members in the Transfer Object are defined as public; Transfer Object class may provide a constructor that accepts all the required attributes.

No comments: