Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stub vs TO

 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
What are some basic differences between a stub and Transfer Object?
 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
think of a stub as a skeleton that contains all methods available to invoke. but every time you invoke a method on the stub the stub forwards the request to a machine where the actual object is, there the execution takes place then that machine send the output of the execution back to you (return value or exception etc). so using stubs always involves network traffic, BUT they make things look like as if the execution is taking place on your machine not the host/server where the actual object is.

Transfer Object is different, the host/server sends a copy of an object to the client so you have the original object (on the server/host) with its actual instance values and there is the copy (on your machine), if the original object changes the copy will have no idea, but it allows you to get rid of network traffic, and it makes development a little easier since you don't have to handle network exception.

there are cases where you must use stubs, and there are cases where you can use TO, so it depends on the situation.

hope that helped
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic