Skip to content

2008 12 19 it provides a mixin mechanism

Fabian Schmied edited this page Dec 19, 2008 · 1 revision

Published on December 19th, 2008 at 16:03

It provides a mixin mechanism

So, what is that re-motion mixins library, actually? In one sentence: it’s a library providing a mixin mechanism for static programming languages on the .NET platform.

This is probably not enough for making people ask me for autographs when they meet me on the street. So, let’s try to go into more detail. Let me take the main part of that statement and explain it: the library provides a mixin mechanism.

Mixins are a device for code reuse known mostly from dynamic programming languages such as Python, Ruby, or Perl. C++ templates can also be used to create mixins. While the specific implementations and feature sets vary from language to language, all mixin implementations have one thing in common: they aggregate code from different sources into single objects.

As Wikipedia tells me, the term "mixin" stems from ice cream, actually. Apparently, the creators of "Flavors", a LISP implementation of object-oriented programming, took the name from Steve's Ice Cream Parlor in Somerville, Massachusetts. Steve's Ice Cream Parlor sold ice cream that was created in an interesting way: you took some basic flavor, mixed in some extra flavors, and got a delicious product.

In case this is too abstract, let’s simply call it the McFlurry Principle. (Calling it the "Steve’s Ice Cream Parlor in Somerville, Massachusetts Principle" would be more appropriate, actually, but that just doesn’t seem to have the same flow. McFlurry, by the way, is a trademark owned by the McDonald’s Corporation, to which I have no affiliation whatsoever. I don't think I've ever even eaten a McFlurry, I have no idea what it tastes like, and I'm told the competitors have similar products.)

The McFlurry principle: take some base flavor, mix in extra flavors, get delicious product.

What does this have to do with software development? Well, mixins in software development also follow the same idea: you take some basic code model, you mix in additional stuff, you get a fully-featured product. That’s the idea behind mixins.

Up next: Mixins the re-motion way. Soon.

- Fabian