DCL

An elegant OOP with mixins + AOP for JavaScript.

Documentation

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.

Getting started

Module documentation

Library documentation

dcl comes with a small library of useful advices, mixins, and base classes:

  • Advicesvarious debugging, cache, and AOP helpers
  • Basesconstructor helpers
  • Mixinslife-cycle helpers

Advanced topics

  • Decoratorexplains the concept of decorators, and how they are used in dcl
  • Supercalls in JSdiscussion of different methods to do supercalls in JavaScript, their pros and cons, and what was selected for dcl and why
  • Constructorsdesigining robust mixin-aware constructors
  • Multi-stage constructionimplementing multi-stage construction
  • Destructorsdestructing objects and freeing its resources is a serious business
  • OOP and JSdiscussion of advanced OOP, its deficiencies, and ways to overcome its problems
  • OOP in JS slidesmy 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
Fork me on GitHub