|
|
|
|
|
by jmcomets
1386 days ago
|
|
This is what you'd do in a classic OOP approach. Allows for different behavior across variants by pulling out the shared interface. (I think this is what the author mentions when they speak of "different level of abstraction"?) The downside of this approach is that for subtrees of shared behavior you can go the multi-level inheritance route (risky if you're not sure the leaves will hold their parent's contract) accept the extra boilerplate for similar behavior. It's interesting to me how this happens quite often and polymorphism is still our go-to solution. |
|