Download Offline Manual - Docs
Transcript
qooxdoo Documentation, Release 4.1.1
• static class: Only contains class variables and class methods. Often a helper or utility class. Use type :
"static".
• abstract class: Does not allow an instance to be created. Typically classes derive from it and provide concrete
implementations. type is abstract.
• singleton: Not more than a single instance of the class may exists at any time.
getInstance() returns the instance. Use type : "singleton".
A static method
Interfaces
qooxdoo’s interfaces are similar to the ones in Java. Similar to the declaration of class they are created by
qx.Interface.define(name, config). They specify an “interface” (typically a set of empty methods),
that classes must implement.
Mixins
Mixins are a very practical concept that not all programming languages provide. Unlike interfaces, which require a
class to provide concrete implementations to fulfill the interface contract, mixins do include code. This code needs to
be generic, if it is “mixed into” different existing classes. Mixins usually cover only a single aspect of functionality
and therefore tend to be small. They are declared by qx.Mixin.define(name, config).
Inheritance
Like most programming languages qooxdoo only supports single-inheritance for classes, not multiple-inheritance, i.e.
a class can only derive directly from a single super class. This is easily modeled by the extend key in the class
declaration map.
Since a class may implement/include one or many interfaces/mixins, which themselves can extend others, some advanced forms of multiple-inheritance can still be realized.
qooxdoo OO standalone
If you want to use qooxdoo OO layer standalone take a look at qx.Server.
2.1.2 Features of Object Orientation
Class definition
A class is defined by providing its name as a string:
qx.Class.define("my.cool.Class");
This example only creates a trivial class my.cool.Class. A typical class declaration contains OO features like
constructor, instance members, static members, etc. This additional information is provided as a second parameter in
form of a map. Since the entire class definition is given in qx.Class.define(), it is called a “closed form” of
class declaration:
qx.Class.define("my.cool.Class", {
// declare constructor, members, ...
});
A regular (non-static) class can simply be instantiated using the new keyword:
12
Chapter 2. Core
Related documents
Offline Manual - Docs
3.5.x - Docs
Offline Manual - Docs
qooxdoo Documentation
1.5.x - Docs
Get the PDF - Docs
qooxdoo Documentation
Techcraft e-Newsletter Volume 38 June 2008.
DISCOVERY.net
Apache Struts 2 Web Application Development:
JavaScript Test Runner
Red Hat JBoss Web Framework Kit 2.1 TorqueBox Quickstart Guide