4.4. Value Objects/Data transfer object class.
In order to send multiple values from one layer to another layer, it is recommended to combine multiple values into single object and send that object ot destination layer. It is not recommended to send multiple values between two layers foe multiple number of times. The class whose object combines multiple values into single object is called ValueObject class or DataTransferOject class.
- The implementation of this design pattern reduces round trips between two layers and it also makes easy to receive values only for one time in the destination layer.
- In struts application FormBean class acts as ValueObject class or DataTransgerObject class. Because multiple values given by form(data means form data) or stored into single object called FormBean class object and this FormBean class object is implicitly visible in the action class execute(). The business logic of execute() uses form data as input values by reading them form FormBean class object.
- In struts applications Form data of the view layer is visible Action class of modellayer. In the form of FormBean class object.