IT lexicon › Programming › Mixin

Mixin

Programming På svenska → Updated: 2026-05-24

A class/module designed to be composed into other classes — contributes functionality without being a standalone type.

Ruby include Module, Python multiple inheritance, Scala traits, JS via Object.assign patterns, Sass/SCSS @mixin. Solves problems plain inheritance doesn't (combining functionality from several sources). Risks: diamond inheritance, name collisions. Modern alternative: composition (object has-an-object) instead of inheritance.

← Back to the lexicon