|
![](/i/fill.gif) |
>> Heh. It amuses me that run-time polymorphism via inheritance is /the/
>> central contribution of the OO movement, and here I am reading a book
>> warning me not to use inheritance under any circumstances unless
>> absolutely unavoidable...
>
> So, what's their solution? You have to reinvent the wheel all the time?
Use interfaces instead.
> So if you need a linked list of widgets and a linked list of gizmos, you
> have to have two complete sets of add(), remove() and iterate() methods?
That is better handled with generics than any kind of inheritance. A
better example might be a single-linked list and a double-linked list.
Post a reply to this message
|
![](/i/fill.gif) |