This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we use value-object with session beans????  RSS feed

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

I am developing EJB CMP2.0 Application. I have Created Sesion Facade for my Entity beans which persists data inti database. At my client side i m accessing Session bean & inside session beans I m passing field values for my Entity beans. But this requires accessing all getters n setters inside Session Bean for passing values to Entity Bean. But I don't want to use each getter n setter of all fields bcoz this results in n/w overhead. So my question is can we use a ValueObject class for Sesion Beans for Data Transfer from Client to Server??

If yes/no why???

Please help me.
Thanx in advance.
Prash
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. How are you currently doing this?
 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am currently Accesisng Entity bean with local interface inside session bean. & then I am accessing that sesion bean with remote interface into my client file. But now I am not using any value Objects for passing data from client to session bean. I am just passing values by accessing each filed inside my sesion bean on Client side & then assigning value to it through sesion beans remote interface. But As I m accessing sesion bean with remote interface I think this way will create n/w overhead. So Can i use hare Value Object for passing values betn Client n Sesion Bean???

Thanx

Prash
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not only can you, but you should. Updating a record one field at a time with a round-trip from the client to the database and back again via an EJB is not a sensible way to do this.
[ February 24, 2006: Message edited by: Paul Sturrock ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!