What are, exactly mixins?
Are there any techniques to achieve that in c#?
views:
74answers:
2
+3
A:
A mixin is a set of class members that can be "mixed" into a class without the problems of multi-inheritance.
C# doesn't have mixins per-se, but offers Extension Methods for similar goals.
dtb
2010-08-04 13:00:27
Although is not quite a mixin. Would have a easy to see example in any pseudo or real language?
NoProblemBabe
2010-08-04 13:43:46
@NoProblemBabe: For example, Ruby provides the `Enumerable` mixin which can be mixed into classes that are enumerable to extend the class with methods for filtering, mapping and sorting. C#/.NET has the static `Enumerable` class which provides Extension Methods for filtering, mapping and sorting classes that are enumerable ("LINQ").
dtb
2010-08-04 15:42:26