Re:OOP Is Dead, Long Live OOP
by seanmcdirmid on Thursday October 18, 2018 @03:23PM
(#18251332)
Mixin inheritance is also inheritance, just linearized multiple inheritance actually.
[ Parent
| on HN ]
Mixins can be modeled as inheritance or as composition.
Re:OOP Is Dead, Long Live OOP
by dragonwriter on Thursday October 18, 2018 @05:30PM
(#18252310)
They can be modeled as inheritance or as composition plus delegation, but that's not saying much since inheritance itself can be modelled as composition plus delegation.
I think composition and mixins should be kept separate. In my mind (and maybe I have an incorrect view of it), mixins throw a bunch of new properties on the base object, whereas composition keeps the original object encapsulated in a single property. Would you consider the second type to be a mixin? I've never heard it described that way.
Re:OOP Is Dead, Long Live OOP
by seanmcdirmid on Thursday October 18, 2018 @04:10PM
(#18251703)
Both Flavor-style mixins and Bracha style mixins utilize inheritance. All mixin definitions should fan out from that early work.