Re: Confusion With Inheritance
- From: "Brad" <bradwebber@xxxxxxxxx>
- Date: 25 Aug 2005 19:45:31 -0700
Hi there Robert, H.S. Lahman, and Micahel, thank you all for your
comments and suggestions.
Robert, you are of course correct in your assumption that the Product
class has behaviour other than displaying itself.
> Displaying the product must be relegated to some
> outlying classes.
Perhaps something like ProductViewer? ProductViewer could consist of
one static/shared function called GetProductData that accepts a Product
as a parameter and returns the appropriate information.
> Object Oriented Design is a discipline for
> partitioning *behavior*, and *incidentally* the data that goes with
> that behavior.
Let's say the Product class does survive as a class. Am I correct in
assuming that you would discourage subclassing SkinCare products and
Makeup products and instead design a single Product class that had
UNDEFINED attributes depending on the type of product that was
instantiated?
Just to summarise, I think there are two issues that are being
discussed now. The first is the actual design of the Product class (or
classes, depending on your approach), and the second is the best way to
display a Product to the user.
.
- Follow-Ups:
- Re: Confusion With Inheritance
- From: Robert C . Martin
- Re: Confusion With Inheritance
- References:
- Confusion With Inheritance
- From: Brad
- Re: Confusion With Inheritance
- From: Robert C . Martin
- Confusion With Inheritance
- Prev by Date: Re: Singleton Pattern
- Next by Date: Re: chooses not to generate code at all
- Previous by thread: Re: Confusion With Inheritance
- Next by thread: Re: Confusion With Inheritance
- Index(es):