MiXer

MiXer is a JavaScript that makes implementing the mixin pattern a bit easier. Essentially, mixins are a form of multiple inheritance where a class pulls from other classes on an “individual unit of functionality” (i.e. method) level. JavaScript technically doesn’t have classes, but rather is a prototype-based language.

Objects are cloned from the prototype of a function. This is a simple JavaScript library that attempts to provide some object-orientation without forcing the so-called “classical paradigm” on JavaScript like many other libraries do.

Instead of the base OO paradigm being classes, MiXer provides the capability to create “modules.” A module collects properties and functions in one place. Those can then be “exported” to other objects’ prototypes. Modules can also be “protized” in order to turn them into a prototype and allow objects to be created.

The developer can also designate members of modules mixable or non-mixable, for a very simple level of access control.

The library is purposefully lightweight and very generic in order to allow the greatest flexibility for the developer. Modules can be used to model something akin to classes, or they can be modeled as individual namespaces in a procedural pattern, or they can be a bit of both.

The goal of mixer is to fully support object oriented JavaScript, but in a way that stays true to JavaScript itself.

For those who like it short and simple, MiXer provides a simple layer of abstraction for prototype copying in order to reduce verbosity of code.

Links:
Check it out on github