-
Notifications
You must be signed in to change notification settings - Fork 7
Mixins
sagifogel edited this page Aug 24, 2014
·
30 revisions
A mixin is an interface with implemented methods.
Mixins exists in .NET in the form of object oriented interfaces implementation.
In object-oriented programming languages, a mixin is a class which contains a combination of methods from other classes. How such a combination is done depends on the language, but it is not by inheritance. If a combination contains all methods of combined classes it is equivalent to multiple inheritance.
NCop allows the notion of multiple inheritance as opposed to .NET object oriented.
Mixins fits well with the concept of composition over inheritance.
Let's create a new interface type that will inherit its functionality using mixins.
public interface IDeveloper
{
void Code();
}