DCL

An elegant OOP with mixins + AOP for JavaScript.

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

Module documentation

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