Home
Core Java
Java
JDBC
Servlets
JSP
EJB
JMS
Struts
Spring
Hibernate
JSF
RMI
CORBA
J2ME
Performance
Tomcat
Weblogic
Design Patterns
Junit
XML
UML
DB2 & SQL
ANT
Free Gift
Contact Us

XML RSS
What is this?
Add to My Yahoo!
Add to My MSN
Add to Google
 

J2EE Pattern

Transfer Object Pattern

Your Ad Here

Creational patterns Structural patterns Behavioral pattern J2EE patterns
Abstract Factory Adapter  Chain of Responsibility
MVC 
Builder Bridge  Command  Business Delegate
Factory method Composite  Interpreter  Composite Entity
Prototype Decorator  Iterator  Data Access Object
Singleton Façade
Mediator  Front Controller

Flyweight  Memento  Intercepting Filter

Proxy  Observer  Service Locator


State  Transfer Object


Strategy 


Template Method



Visitor 

Transfer Object Pattern



Define transfer Object Pattern
Using a serializable class to act as data carrier, grouping related attributes, forming a composite value and working as a return type from remote business method. Also known as Value object.

Where to use & benefits
Get related values from remote business method.
Fetch multiple value in one trip.
Decrease network traffic.
Minimize latency and server resource usage.

Related patterns include
  • Composite view

Example of Transfer Object pattern
In the J2EE server, the client tier may make several calls to retrieve data from the enterprise bean. Even in the same machine, the every call from the client tier to the server tier is a remote method call. Think about use Transfer Object design pattern to retrieve related attributes and return a single object instead of each call just for retrieving a single attribute value. The transfer object is passed by value to the client. All calls to the transfer object instance are local calls to the client, so such design saves a lot of network traffic.

Let's say that you have a remote banking system. If the user has five requests one time, you should design your system to give response once, not five times. You may need to group all return values from these five requests to an object carrier and then return to client just once. Once the client program receives the instance of this object, it invokes the accessors and gets value to display. The total network traffic for one user just once.

Your Ad Here




footer for Transfer Object Pattern page