[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Spread a class over multiple files

Mark Summerfield <list at> writes:

> Sometimes I want to spread a class over multiple files.

When I run into such a use case, I use (multiple) inheritance --
with "mixin class"es.

Each "mixin class" handles some important aspect and is only loosely
coupled with maybe a common base class and the other aspects.
The main application class integrates the mixin classes via inheritance --
when it needs to handle the respective aspect.

Each mixin class can be implemented in its own file.