/encapsulate

A JavaScript OO system

Primary LanguageJavaScriptMIT LicenseMIT

Encapsulate

A JavaScript OO system

Contents

  1. Introduction
  2. Requirements
  3. Usage
  4. Tests

Introduction

Encapsulate is a compact OO system for JavaScript that allows you to easily create object instantiators (You probably know these as classes) using a combination of traits (Objects or functions providing members) and other instantiators (You probably call this inheritance).

Encapsulate is similar to StampIt in many regards and Ring.js in others.

Much like StampIt, Encapsulate allows you to construct instances using factory functions that can easily be re-used by multiple instantiators (StampIt calls these stamps).

Similar to Ring.js, Encapsulate allows you to re-use your instantiators (Ring.js calls these classes) for inheritance purposes. As with Ring.js, Encapsulate makes use of C3 Linearization to implemented a well-behaved multiple-inheritance scheme.