• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tight coupling in Data Layer  RSS feed

 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a design question:

In my data access tier I am implementing Value Objects and Data Access Objects. I have a module class that has a getValueObject method and then a getDataAccessor() method is called on that Value Object. My problem is that I would like to avoid the tight coupling of the Value Objects and it's corresponding Data Access Object. Is this possible? Any suggestions/ideas or greatly appreciated.

Thanks,

Kerry
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my own apps, I've overcome this quandry by creating a system where I have simple data objects loaded by other objects. It makes the simple data objects agnostic of who, when, why, or how they are loaded, so I can change out the loader (interface: Loader) via a factory or other method without changing the rest of the code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!