Glossary: Mixin

A mixin class is one that does not embody a complete rounded concept, capable of being an object, but rather some attribute that is shared by a number of otherwise dissimilar objects. Rather than reimplement the attribute in each class, it has its own class and is then added into any class that needs it by inheritance. Note that C++ (unlike Java) allows multiple inheritance, so any number of attributes can be "mixed-in" to add "flavour" to an class.

For example the ROOT class TAttLine describes the attributes of a line (colour, width etc.) and is used by other classes such as TBox and TLine, that require line attributes.

Go Back to the The Glossary Top Page

If you have any comments about this page please send them to Nick West