cf2:Class

Purpose

Provides methods that simplify the task of creating classes.

Exported Features

cf2:Class

Imported Features

n/a

JavaScript

This component adds the following method to the V$.Class object.

create()

Creates a new class, i.e. returns the function that represents the class.

A class object has the following methods. Please note that none of these methods will be inherited by an objects created from the class because they are properties of the class object and not its prototype.

methods(m)

Adds the functions defined in the Map of methods to the prototype of the selected class.

Parameter Description Type
m The Map of methods (functions) to add to the class. Methods
mixin(c)

Calls methods(c.prototype). Please note that mixin classes must not provide initialize(), it is an error if c.prototype.initialize is defined.

Parameter Description Type
c The class from whose prototype the methods will be added to this class's prototype. Class
Note:

The mixin(c) method should be used instead of the mixin(sourceClass, targetClass) method provided by the cf2:Mixins component.

Related topics