3 ms·
1. The production of “frameworks” that provide default behavior that can be extended or changed. 2. The modeling of taxonomies (Aristotolian). 3. Modeling fix
by aryehof 4y ago
1. The production of “frameworks” that provide default behavior that can be extended or changed.
2. The modeling of taxonomies (Aristotolian).
3. Modeling fixed generalization-specialization relationships.
- travisjungroth 4y agoI agree with 1 and 3, but IME using inheritance to model taxonomies is usually a big mistake. It can work well for things inherent to the system (Iterable -> Sequence) but it falls apart when you're trying to model the real world (Mammal -> Dog). It's essentially about whether you're making stuff up, and can choose to operate within the bounds of the type system to get its benefits (the first case) or you're trying to describe something real and any trade-off is actually bad (the second case). It doesn't help you to be unable to express a portion of the problem, but in exchange you get something that doesn't apply. Commentary on an excerpt from an interesting blog series: https://softwareengineering.stackexchange.com/a/361176 https://softwareengineering.stackexchange.com/a/361176
- aryehof 4y agoI somewhat agree, but note that I qualified point 2 with “Aristotelian”. The alternative “prototypical” view (which is what most want to use inheritance for) is unsuited. Regarding the link, I remember Eric Lippert’s series of blog posts and his struggle to (initially) model a prototypical type problem using inheritance. I remember thinking at the time that he was limited in his object modeling experience to only the constructs provided by the C# language. There are no language constructs that specifically deal with rules relating to (optionally) collaborating objects, as he discovered.