• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use ValueObject Class in EJB????

 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on EJB Project. Currently it is successfully running from client (JSP) without any ValueObject, just calling getter n setter on each parameters in my EJB , but it is not good as it takes individual trip for each parameter. So I want to use ValueObject Class that holds all parameters in it & the values of all parametars should pass to/from server from/to client as Object of ValueObject Class. So no much overhead will be needed as i ve to only access single object single time. How to this? I ve done it using simple serializable class & putting all getters n settrs for corressponding parameters in EJB. But I think for this method it requires that the my valueobject class should be at both sides at client & at server. But I don't want to expose my valueobject class to client. So what is best way to do this using valuobject?

Please help me.

Thanx in advance.

Prash
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your webapp is deployed into the same server as your ejb tier, the "best" answer may be - don't use value object, aka DTO. If you are using local interfaces then the notion of multiple round trips to your entity beans really isn't a big issue. Typically the performance problems people hit are completely unrelated to this. Improper transaction handling will cause extra EJB loads and stores. The solutions are either to use client-side JTA transactions or to use a stateful session bean to temporarily cache the values you will read. The JTA solution is better if you'll be both reading and writing entity bean fields.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!