*
The moose likes OO, Patterns, UML and Refactoring and the fly likes DAO with Struts doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "DAO with Struts doubt" Watch "DAO with Struts doubt" New topic
Author

DAO with Struts doubt

kalpana Kumar
Ranch Hand

Joined: Jul 03, 2003
Posts: 65
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

Joined: Jan 29, 2003
Posts: 8791
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 ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
GeeCON Prague 2014
 
subject: DAO with Struts doubt