• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TransferObject Design Pattern?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What exactly is the use of such a design pattern?? Any examples please?
 
Ghufran Ul Haq
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your application is distributed over many sites.
You do not want to call remote methods for getting different values. This will increase network treffic and reduce application performance.

In order to improve, you transfer a whole object containing different values and then use the object locally. So that you put only one remote call resulting in better performance.



Ghufran Ul Haq
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just one point to add - stale data.

As Ghufran says, while this object prevents the need for multiple expensive calls by caching data, the data it contains is constantly going out of date as it is not connected to the db.

This is the one downside of this pattern and its impact should be assessed when evaluating it's use. If you need accurate data 100% of the time (and this data constantly changes) then the more expensive calls may be better for you. If your data doesn't change all that frequently, this could really help your performance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
* You want clients to access components in other tiers to retrieve and update data.
* You want to reduce remote requests across the network.
* You want to reduce network traffic.

I lamely pasted this content from Marc's recommended document on patterns. Download it, study it, and get 100% in patterns
http://faq.javaranch.com/view?PeabodyOnScwcdPatterns
 
Hendy Setyo Mulyo
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, Marc's note on design pattern has been proven really effective. I got 100% score on design pattern.
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and if you don't, there is always that free beer.
 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You remind me of fridays Mark.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic