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 by:autobot
Honk if you love justice! And honk twice for tiny ads!
a bit of art, as a gift, that will fit in a stocking