>Having a property or method that is not in the parent class can be indicative of a poor class design. The purpose of the highest class level is to define the public interface for all of its subclasses. Introducing a new property or method down the inheritence tree causes the interface to change within the particular class.
I would say that was a little extreme, Jim. All that's necessary is that the child is-a parent. It's not necessary that a parent is-a child (with respect to interface).
There are two main reasons to subclass: specialization and extension. Both reasons allow adding private/protected properties and methods. The second reason allows adding public methods.
What you're describing is called "class flattening," and can itself be indicative of bad design.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only