Patterns
The class.js file defines JS.Class, JS.Interface, JS.Module and JS.Singleton; generic
components to help you build specific functionality. The other files in the download implement a number of
commonly used design patterns and reusable components that provide pre-built solutions to common coding
problems.
JavaScript’s power and flexibility allow parts of the implementation of some design patterns to be automated. The design pattern implementations presented here allow you to use design patterns to create robust code, letting you focus on your specific problem rather on on the details of the pattern you are using.
The components and patterns provided by JS.Class are listed in the sidebar. They all provide
some concrete implementation for solving specific problems, which is what sets them apart
from the class.js components. The files contained in the download are as follows:
command.js– definesJS.CommandandJS.Command.Stackcomparable.js– definesJS.Comparabledecorator.js– definesJS.Decoratorenumerable.js– definesJS.Enumerableforwardable.js– definesJS.Forwardablelinked_list.js– definesJS.LinkedList.Doubly.Circularmethod_chain.js– definesJS.MethodChainobservable.js– definesJS.Observableproxy.js– definesJS.Proxy.Virtualruby.js– definesJS.Ruby, a Ruby-like DSL for writing classesstate.js– definesJS.State