mClass
Implementing class like functionality using prototypal inheritance.
Making object oriented programming in JavaScript a bit easier, at least for people with a background in class based programming languages like C++, Java and C#.
See the mClass homepage for more information.
Examples
See tests.js for examples of how to use mClass.
/*How to use mClass */ var Animal = ; var snake = "snake"; ; ; // A class without private methods or members is much easiervar Bird = ; var dove = "dove"; ; ; ; ; ; // If you don't like new, you can use Object.create()var sparrow = Object;; // A class with private methods and members is a little bit more workvar Fish = ; // Test inherited static function; var minnow = "minnow"; ; ; // Test augmentation // You can only extend from one class, but augment your classes with other classes and objects // Augment a object literalvar weightService = weight: 10 { return thisweight; }; // Augment another mClass instance. You can even use private variablesvar Skin = ; // A new class augmenting the object and class abovevar Dog = ; var dog = 'dog'; ; dog;;
MClass is written by Edwin Martin and is licensed with the MIT license.