|
Project Information
Members
Featured
Wiki pages
|
SummaryDespite the undisputed prominence of inheritance as the fundamental reuse mechanism in object-oriented programming languages, the main variants — single inheritance, multiple inheritance, prototype inheritance and mixin inheritance — all suffer from conceptual and practical problems. This project provides a Javascript implementation of traits, a simple compositional model for structuring object-oriented programs. A trait is essentially a group of pure methods that serves as a building block for classes and is a primitive unit of code reuse. In this model, classes are composed from a set of traits by specifying glue code that connects the traits together and accesses the necessary state. This library (and the above paragraph) are based on the research of Nathanael Scharli, Stephane Ducasse, Oscar Nierstrasz, and Andrew P. Black. For more information on traits see the traits website or read the research paper from which this project drew its inspiration (pdf). Getting StartedTo get started with JSTraits first check out the documentation at TraitSynopsis then download the latest release and give it a whirl. |