dean.edwards.name/common/

common

common is a small set of JavaScript functions that enable simple object inheritance. Using these functions I aim to build a library of JavaScript classes and objects to aid DOM scripting (or any other kind of scripting).

The important thing about this project is not the set of JavaScript functions that enable inheritance, it is the development environment. The web IDE provides a visual model of common classes. Once you have a map of the classes in your head, object-oriented development is a breeze...

This project is very much in its infancy and I’m not sure where it is ultimately headed. Although it is a pet project, if it works out OK, I may use it for more serious work. I’m definitely enjoying building it whatever it becomes. :-)

Using the core functions previously mentioned, I hope to evolve common into a neat little development environment. Each step in the evolution process will take what has existed before and specialize it. The first variation is special0. The most recent variation is special0.1

Platforms

Core functionality relies on two JavaScript functions that are not supported on all platforms:

I will add support for the above two platforms in future versions (probably special0.3 or special0.4). The web interface relies heavily on DOM scripting, so only modern browsers should be used. However, classes and objects produced by common may be used in any browser.

In current variations of common, comments are preserved only in Internet Explorer. Other browsers reformat JavaScript functions and inline comments are lost. For that reason, I recommend using Internet Explorer while common is in its infancy. In future versions, class definitions will be stored using HTML rather than JavaScript and comments will be preserved on all platforms.

Current Variations

Examples

special0

The first variation of common. Only one class - the Common class. The object/class browser exists as a separate JavaScript file.

This version provides:

Examples:

Shape Example
Based on OO Shape Examples.

special0.1

A variation of special0.

special0.1 adds the following.

Examples:

Hello World
Click "Run" to see the results. The code is in System.sysin.
Shape Example
Runnable version of the special0 example.

special0.2

A variation of special0.1.

special1

The idea is that special1 is pretty much the same as special0 except that it is written in entirely in special1.