Welcome to the homepage of Classages, a novel object-oriented language featuring interaction-based programming.
At its heart, Classages has a new object model different from that of the mainstream languages such as Java and C#. Classes and objects in Classages are fully encapsulated, with explicit interfaces for all interactions they might be involved in. Many concepts important at software design phase - such as relationships, roles, multiplicity, navigability and ownerships - are directly supported at the programming language level. Such support is essential when software development grows large, as it lessens the impedance mismatch between software design and implementation, and results in smooth round-trip software engineering.
As the underlying object model is fundamentally different, new names are given to the language constructs of classes and objects in our language: classages and objectages respectively, with Classages also being the name of the language.
The design of Classages reflects several principles that mainstream OO languages do not fully embody:
- Principle of Separation of Statics and Dynamics: In
Classages, how a classage is to be reused (statics) is completely
orthogonal to how its runtime instance is to communicate with other
runtime instances (dynamics). This is often not true in Java-like
languages, where overriding - a code composition operation
(statics) - is almost always tethered to dynamic dispatch
- Principle of Separation of Internals and Externals: In
Java-like languages, all objects are peers: they communicate with
each other in an equal status manner via message passing. This
results in a mismatch between software design and its
implementation: at design phase, it is very common for two objects
to form a whole-part relationship, and yet when such a design is
implemented in a Java-like language, such a relationship is not
represented. In Classages, an objectage owns different kinds of
interfaces to communicate with its parts (or its whole) and
with its peers.
- Principle of Interaction Bi-directionality:
Interactions are fundamentally bi-directional. Interfaces defined in
Classages can not only declare what a classage (or its runtime
objectage) provides to others, but also what it expects from
others. Interaction is a process of each party provides what the
other party expects.
- Principle of Least Privilege: When an interaction
happens, two parties should only expose to the other the narrowest
interface necessary. A natural corollary from this is, when an
object communicates several different objects, it should be able to
define different interfaces for each communication, exposing those
- Principle of Relationship Lifespan: Object
relationships are dynamic with a lifespan: initiation, duration and
termination. Classages has a clear notion of long-lived
interactions, whereas in Java-like languages, the lifespan of the
relationship resulting from message passing is only ephemeral.
- Principle of Relationship Multiplicity: Relationships
in the object world can be either one-to-one, one-to-many or
many-to-many. Classages allows programmers to declare whether an
interaction interface is singleton or generative to create
relationships with various multiplicity.
- Principle of Relationship Statefulness: Relationships
are frequently stateful in their own right. Note that in Java-like
languages, objects themselves are stateful, but there is no explicit
language construct to define states belonging to certain
interactions between objects.
Please refer to the Publications page for a detailed description of the Classages. For those interested in trying out the language, the Classages compiler is available for downloadin the Download page. The Online Manual together with a few source code examples is provided for the correct use of various Classages language constructs.