• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO with Struts doubt

 
kalpana Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to use DAO for Data Access. I have a DAOFactory that is used to return the implementations of DAO's.
One particular DAO returns a Value Object and a session bean is used in between DAO and Value Object which just calls the DAO method and returns a value object.
It is this session bean that is called in the Business Delegate of the Struts.
But my doubt is the Value Object.
Should I have 2 value Objects?. One for DAO and one for session beans?.
I am a kind of confused.

Thanks
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this what you have?

I have no problem with that at all. Using the same ValueObject in both places makes the client dependent on changes to the underlying data model.

Some times there is value in making very specific VOs that contain exactly what the client needs, no more, no less, and making different ones for different clients. I wouldn't do that on my first cut, though. Only after performance or some other strong reason comes up.
[ January 12, 2005: Message edited by: Stan James ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic