-
Book Overview & Buying
-
Table Of Contents
qooxdoo Beginner's Guide
Interface is a simple concept but plays a vital role. It provides abstraction on implementations and polymorphism. It is said in the basic design principles that:
Code to an interface, rather than to an implementation
Follow the dependency inversion principle (depend upon abstractions, not on concretions)
An interface is a contract. Interface can be implemented by any class, from any inheritance tree. One class can implement many interfaces for different purposes. Interface allows you to give a common characteristic for different classes. For example, a class that implements an interface called Validator will have the validation behavior implemented. Let's see how to define this contract in qooxdoo.
In qooxdoo, the items (in the contract) that can be included in an interface are discussed in the following sections.
A member function of the interface can have either an empty definition or a set of preconditions to be checked. These preconditions are validated before calling...
Change the font size
Change margin width
Change background colour