Documentation 1.x
Version 1.x
dcl
is a micro library written in JavaScript for node.js
and modern browsers that implements OOP with mixins + AOP at both “class” and
object level.
Its repository is hosted at https://github.com/uhop/dcl – version 1.x branch is called dev1x
.
Getting started
- Installation - super-simple ways to install
dcl
- Tutorial - hands-on with
dcl
- Cheatsheet - look up common operations
- ChangeLog - an official record of changes
Module documentation
- mini.js - minimal
dcl
kernel, you might want to use it on browsers to conserve bandwidth- dcl() - the composition engine
- dcl.superCall() - super call decorator
- dcl.js - full
dcl
kernel that includes chaining control and AOP support- dcl.advise() - general advice decorator, includes useful shortcuts:
- dcl.before() - “before” advice decorator
- dcl.after() - “after” advice decorator
- dcl.around() - “around” advice decorator
- chaining directives:
- dcl.chainBefore() - “before” chaining directive
- dcl.chainAfter() - “after” chaining directive
- dcl.advise() - general advice decorator, includes useful shortcuts:
- advise.js - object-level AOP with dynamic advisement
- advise() - general advice directive, includes useful shortcuts:
- advise.before() - “before” advice decorator
- advise.after() - “after” advice decorator
- advise.around() - “around” advice decorator
- advise() - general advice directive, includes useful shortcuts:
- inherited.js - dynamic super calls without decorators
- inherited() - super call
- debug.js - error-checking and introspection facility
- dclDebug.log() - log information of classes and objects
- legacy.js - support for legacy browsers
Library documentation
dcl
comes with a small library of useful advices, mixins, and base classes:
- Advices - various debugging, cache, and AOP helpers
- Bases - constructor helpers
- Mixins - life-cycle helpers
Advanced topics
- Decorator - explains the concept of decorators, and how they are used in
dcl
- Supercalls in JS - discussion of different methods to do supercalls in JavaScript,
their pros and cons, and what was selected for
dcl
and why - Constructors - desigining robust mixin-aware constructors
- Multi-stage construction - implementing multi-stage construction
- Destructors - destructing objects and freeing its resources is a serious business
- OOP and JS - discussion of advanced OOP, its deficiencies, and ways to overcome its problems
- OOP in JS slides - my presentation at
ClubAjax partially based on the blog post above;
dcl
was introduced as an experiment to create a balanced OOP + AOP package, which helps leverage mixin-based techniques