[thelist] OOD question

Steve Lewis nepolon at worlddomination.net
Thu Oct 7 15:47:17 CDT 2004

Scott Dexter wrote:

> class User : DataAccess
Sounds like bad naming more than anything else.  What is a DataAccess 
object like anyway, in this case?  Maybe DataAccess should be Record? 
  In that case a UserRecord would naturally extend Record.  Not being 
able to interpret the member variables and methods makes my comments 

> practices' and wiring up a data access layer to classes. Would/Have
> you done the above? Or would you instead instantiate a separate data
> access class inside the User class? Something else?

I insulate my Records (an elaborate property map with synchronization 
and serialization logic) behind a Manager (UserManager in this case) 
which uses the DB and UserID as parameters to most of its functions, 
according to business logic.  It returns a DAO (a User object in this 
case) that exposes the expected OO accessors for the underlying 
properties.  The User object would be a stateless object that 
transforms the property map of the UserRecord into something more OO, 
according to business logic.

Steve Lewis

More information about the thelist mailing list