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

Transfer Objects on the client

 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I find that the Transfer Objects are created in the server side and sent to the client.

This is as from the SCWCD book by Hanumant Deshmuk-

The Transfer Object pattern allows you to retrieve all the data elements in one
remote call instead of making multiple remote calls; therefore, it reduces the network
traffic and improves the response time since the subsequent calls to the
object are local
.


Subsequent calls to the object are local... Does it mean that, the methods are executed by the client's JVM now?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it mean that, the methods are executed by the client's JVM now?

Yes. For example, if you call a getter method, the method of the Transfer Object will be simply called, and the value returned. No RMI, no server call. If you'd keep a reference to an EJB to a remote EJB, the call would have to go up to the server and come back.
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks... that helps in understanding this.

But this raises another question... When these calls are local, requiring the client's JVM for executing those, would it not break the application for those clients that do not have a JVM installed?
 
Kaialsh Vashisth
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transfer Object means An object which contains multiple fields data like you have EmployeeInfo thats contains name ,empCode and many others.
Now you call suppose getEmpInfo() method from ejb client(may be servlet) it fatch the whole info in one shot ,then on client (may be servlet) you just call getName(),getEmpCode() ... so these calls are local not remote.
 
mathew jonson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath Murthi wrote:Thanks... that helps in understanding this.

But this raises another question... When these calls are local, requiring the client's JVM for executing those, would it not break the application for those clients that do not have a JVM installed?


Hi,

Not sure if I'm saying something obvious (sorry if I do this), but just to clarify. When you say this, are you referring to clients as users machines or are you referring to clients as a Servlet for example? When a transfer object is executed locally that means that is local to the client virtual machine (and client is referring to the JVM that makes the call, not the "final client" itself). This could be a Swing app, a servlet/jsp in a webserver, etc.

Remember that the "final client" in a web app, I mean the browser, only receives html (well also images, javascript, etc) from the server, so it is not necessary to have a JVM there.

Hope it helps.
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was thinking 'the client' referred to the 'final client' !!!
how stupid! ...and that resulted in a thousand confusions!

Thanks a lot Mathew, It all makes sense now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic