JaiswalTraining

Get the online training



Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com




Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven







Transfer Object
  • Context
    • Application clients need to exchange data with enterprise beans.
Problem and Forces
  • Client invokes a business object's ( Session or Entity EJB ) get methods
    multiple times until it obtains all the attribute values
  • Every call to an enterprise bean is potentially a remote method call with
    network overhead.
  • The number of calls made by the client to the enterprise bean impacts
    network performance and so Application Performance.
Solution
  • When the client requests the enterprise bean for the business data, the
    enterprise bean can construct the Transfer Object, populate it with its
    attribute values, and pass it by value to the client.
The Transfer Objects will be responsible for
  •  Allowing client to make a single remote method invocation to the enterprise
    bean to request the Transfer Object instead of numerous remote method
    calls to get individual attribute values.
  • Allowing client to invoke accessor (or getter) methods on the Transfer
    Object to get the individual attribute values from the Transfer Object.
Structure
  • Class diagram representing the Session Facade pattern


Participants and Responsibilities

  • The sequence diagram that shows the interactions for the Transfer Object
    pattern



Strategies

  • Updatable Transfer Objects Strategy
    •  Where the BusinessObject is implemented as a session bean.
    • In this strategy, the Transfer Object not only carries the values
      from the BusinessObject to the client, but also can carry the
      changes required by the client back to the business object.
  • Entity Inherits Transfer Object Strategy
    • Where BusinessObject is implemented as an entity bean
    • The entity bean extends (or inherits from) the Transfer Object
      class. The only assumption is that the entity bean and the
      Transfer Object share the same attribute definitions.

Consequences
  • Simplifies Entity Bean and Remote Interface
  •  Transfers More Data in Fewer Remote Calls
  •  Reduces Network Traffic
  •  May Introduce Stale Transfer Objects
  •  Concurrent Access and Transactions

Related Patterns
  • Session Facade
    • The Session Facade, frequently uses Transfer Objects as an exchange
      mechanism with participating entity beans. When the facade acts as a
      proxy to the underlying business service, the Transfer Object obtained from
      the entity beans can be passed to the client.
  • Transfer Object Assembler
    • The Transfer Object Assembler is a pattern that builds composite Transfer
      Objects from different data sources..
  • Value List Handler
    • The Value List Handler is another pattern that provides lists of Transfer
      Objects constructed dynamically by accessing the persistent store at
      request time.