< Back
Release Notes v0.5.2
See also the release notes of
0.5.0 and
0.5.1
What's new?
Abstract Caesar Classes Supported
The new version allows to declare Caesar classes as abstract. Similarly as in Java, abstract Caesar classes can contain abstract methods, but cannot be instantiated. However there are some slight differences.
An abstract collaboration can contain concrete classes. It means that late bound instantiation of such classes is allowed. For example
abstract public cclass Graph {
public cclass Node {
abstract Iterator getEdges();
}
public cclass Edge {
abstract Node getStart();
abstract Node getEnd();
}
}
public cclass SimpleGraph extends Graph {
public cclass Node {
...
public Iterator getEdges() {
return edges.iterator();
}
}
public cclass Edge {
...
public Node getStart() {
return start;
}
public Node getEnd() {
return end;
}
}
}
public class TestGraph {
public void test() {
Graph g = new SimpleGraph();
Graph.Node n = g.new Node();
Graph.Edge e = g.new Edge();
}
}
As we can see variable
g
in
TestGraph.test()
is of type
Graph
, which is an abstract collaboration. However
g.new Node()
and
g.new Edge()
are still allowed, because these virtual classes are not declared as abstract within the collaboration. The instantiation is safe because it is late bound to concrete
Node
and
Edge
classes of
SimpleGraph
.
On the other hand a concrete collaboration can contain an abstract class. It simply means that this class cannot be instantiated and therefore may contain abstract methods.
In general a Caesar class can contain an abstract method when it is abstract or some of its enclosing collaborations is abstract, because any of these conditions ensures that the class won't be instantiated.
The implications and restrictions of abstract classes are defined preciselly in the language specification
Classes in the
Abstract Classes section.
Bug Fixes
Please consider the
bugtracking tool for the list of open/resolved bugs.
Known Limitations
- Virtual classes can inherit only from another virtual class explicitly declared in the same enclosing class. If you want to inherit from an implicit class simply override it and leave the body empty.
- There are certain visibility restrictions:
-
package
visibility is not available.
- Class fields can be declared either as
private
or as protected
.
-
cclass
'es must be declared as public
.
- Arrays of cclass-es are not allowed.
- The type checking according family polymorphism rules is not implemented. For this reason the programmer has to manually ensure that objects are not mixed among incompatible families.
- It is not possible for Caesar classes to inherit from pure Java classes. Nevertheless Caesar classes can implement Java interfaces.
- Constructors of Caesar classes cannot take parameters. So more sophisticated initialization must be achieved through additional initializing method call after the object is created.
- Pointcut language cannot refer to Caesar type system but rather to the underlying generated Java classes and interfaces.