[thelist] more OOD fun

Steve Lewis nepolon at worlddomination.net
Mon Oct 11 14:18:11 CDT 2004


Scott Dexter wrote:

> The specifics: Person is subclassed into Guest and Guide classes. The
> Guest class extends Person by adding payment information and
> comments, items not in the Guide class. Now in the application, if I
> don't have teh payment information in the IPerson interface, I can't
> get to it, unless I declare the object as a Guest, which avoids the
> interface, which is not the best thing to do ... right?
There are more complex relationships possible.  I am going to be 
frustrating and answer your questions with other questions.

Why do you need to get the payment information out of the (Guest) 
Person in order to use it?  The class should be more than a data 
structure, remember.  Does it make sense to delegate the 
responsibility of handling payment activities to the Guest itself?

 From there, you can explore a means to allow a Person to address it's 
own responsibilities from a visit.

This isn't always the best solution, but maybe it will work here.  I 
didn't see enough information to decide myself.

-- 
Steve Lewis


More information about the thelist mailing list