MiXer Library: mixins in JavaScript

Mixins in JavaScript certainly aren’t a new idea. However, I noticed a lack of libraries for implementing this pattern. JavaScript libraries like Dojo allow the developer to create something akin to traditional classes. Such a thing is an unnatural pattern for the language. It doesn’t have any base support for classical OOP, so the libraries have to implement tricky functions to mimic inheritance. Even these functions have their limits though.

Mixins are another way to do inheritance in JavaScript. It can be a radical departure from the “regular” inheritance model that many developers are used to. However, once one wraps their brain around it, one may find that it’s a good pattern, and perhaps even a better one for JavaScript. As always, the nature of the system should determine what kind of development patterns are used. This is just one more way of doing it. Check out MiXer to learn more.