News for hackers. Stuff that matters.
Re:Class Hierarchies? Don't Do That by parasubvert on Monday March 31, 2014 @10:53AM (#7501788)
You're taking it too far. One should prefer delegation/composition in most cases, but if you're trying to direct users to a restricted reuse model (inheritance), then it works fine and is often a much clearer approach than "Joe's custom delegation model".

There are plenty of examples of this in practice - someone pointed out NeXT/Apple's UIKit for example elsewhere in this thread (which also uses composition where appropriate). The Java collections hierarchy is also a good one (LinkedHashSet < HashSet < AbstractSet).

There are no comments on this comment yet.