Mixin

A Mixin is a class that provides a certain functionality to be inherited by a subclass, but is not meant to stand alone. Inheriting from a mixin is not a form of specialisation but is rather a means to collect functionality. A subclass may even choose to inherit most or all of its functionality by inheriting from one or more mixins through multiple Inheritance.

Important Pointers:

  • Mixin is not meant to be stand alone.
  • Inheriting Mixin is not a form of Specialization; It is just a mechanism to collect functionality.
  • A subclass may inherit from more than one Mixin.
  • A subclass may just be implementing most of its functionality by inheriting Mixin.

Leave a Reply

Your email address will not be published. Required fields are marked *