[thelist] OOD question

Steve Lewis nepolon at worlddomination.net
Thu Oct 7 17:46:53 CDT 2004


Scott Dexter wrote:

> In this case DataAccess has all the CRUD[1] functions, and User is
> wired to use them directly; a wrapper class doing User-specific
> operations, i.e.

> So it appears (to me) that the usage here is for encapsulation only,
> not inheritance. Which begs the question, why use inheritance instead
> of some other pattern to accomplish this?

Looks like an error to me.  Your encapsulation is illusionary because 
you are extending DataAccess which as you said has all the CRUD 
functions.  that means I can use the User object to exectue an update 
using the DataAccess methods.

It looks to me like it probably shouldn't be extending DataAccess.


More information about the thelist mailing list