From CaesarJ Homepage

Caesar: ReleaseNotes052

< 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 [http://www.st.informatik.tu-darmstadt.de:8080/mantis/] for the list of open/resolved bugs.

Known Limitations

Retrieved from http://caesarj.org/index.php/Caesar/ReleaseNotes052
Page last modified on February 09, 2005, at 02:34 PM