5 ms·
Composition does not strictly imply inheritance. A DOM tree is a perfect example of composing nodes without inheritance.
by dexwiz 6y ago
Composition does not strictly imply inheritance. A DOM tree is a perfect example of composing nodes without inheritance.
- IggleSniggle 6y agoStrange to see this worded this way because I often think of composition as the opposite of inheritance. Instead of “this thing uses this subset of parts from its parent” it is “this thing is composed of this collection of parts.”
- rudedogg 6y agoCan you give an example of how the composition works, or where it is used? With everything inheriting from the Node class, I've only seen it as being an OOP/inheritance system.