Models an is-a relationship, used for polymorphism
Classes can be optionally declared final so as to disallow being inherited from
Mixins
Mixin types must be explicitly noted as such
Mixins can override virtual functions from inherited classes
The mixing class can override the mixin's overrides
Can be used for C++-style CRTP
Bases
A class can base itself on types which are marked final
Cannot upcast to the bases, because the relationship is not is-a
Built-in types can be bases
In all cases, multiple inheritance/mixins/bases is/are allowed.
Inheritance is like traditional C++ inheritance, except that CRTP isn't possible. Mixins are designed for CRTP and are aware of the type they are being mixed into. Bases don't know they're being used as a base, and they can't stop it from happening.
You can alter inherited/mixed-in/based members in compatible ways without having to give entirely new definitions (e.g. just change the privacy, mark final, add or remove virtual, etc)
Inheritance
final
so as to disallow being inherited fromMixins
Bases
final
In all cases, multiple inheritance/mixins/bases is/are allowed.
Inheritance is like traditional C++ inheritance, except that CRTP isn't possible. Mixins are designed for CRTP and are aware of the type they are being mixed into. Bases don't know they're being used as a base, and they can't stop it from happening.