An object that implements this interface can be in one of two states. Either it is a class definition ( {@link #isClassDefinition()} returns true)or it is not. Only objects that are class definitions can be instantiated. Instantiation is done via the {@link #instantiate(NamedObj,String)}method. If an object is instantiated from this object, then the new object is called the "child" and this object is called the "parent." An instance of Instantiable can have at most one parent (returned by the {@link #getParent()} method), but itcan have many children (returned by the {@link #getChildren()} method).An object may be both a child and a parent.
A child is required to be a deep clone of its parent. That is, every object deeply contained by the parent must have a corresponding object deeply contained by the child. The object that is deeply contained by the parent is called the "prototype" and the object deeply contained by the child is called the "derived" object. A derived object has the same name relative to the child as the prototype has relative to the parent. Moreover, a derived object is an instance of the same Java class as the prototype.
This correspondence between a parent and child is called the "derivation invariant." Any correct implementation of this interface must ensure that the derivation invariant is always satisfied, even if the parent changes after the child was instantiated. If new objects are added to the parent, then derived objects must be added to the child. @author Edward A. Lee @version $Id: Instantiable.java,v 1.21 2005/07/08 19:59:16 cxh Exp $ @since Ptolemy II 4.0 @Pt.ProposedRating Green (eal) @Pt.AcceptedRating Green (neuendor)
|
|
|
|