>>Inheritance (in the OOP sense) implies adherence to the Liskov Substitution Principle: that a child object can be used anywhere a parent object can be. A child object "is-a" parent object. I don't think this applies to your example.
>
>I don't know about this. It sounds more like encapsulation to me than inheritance.
I was going to say the same thing about your description! :)
>What I'm describing is behavior oriented. Whether or not the behavior is technically part of the child or parent, is, to me, irrelevant since the end result is the same.
I agree about that. But since the child can't be used wherever the parent can be used, it doesn't behave as a parent, hence fails the usual OOP definition of inheritance.
We in the OOP world are accused too often of disagreeing on basic definitions. I guess this is just an example. :)
Previous
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