Bug #2248
closedNeed to merge corresponding mutable and immutable subclasses of DomainObject
0%
Description
In alpha7, complex, domain-specific objects passed between actors in
collection-oriented workflows were implemented in mutable and immutable pairs,
analogous to Java's StringBuffer and String classes. By convention, only
instances of the immutable versions of these class (which could be constructed
from instances of the mutable versions) were passed between actors. This
approach now appears to be overly complicated.
This issue has been addressed, for now, by adding two methods to the
DomainObject interface (and skeletal implementation): setWriteLock() and
assertNotWriteLocked(). The former method is called automatically when a
DomainObject is added to a collection. By convention, the latter method should
be called from all public methods of domain objects that change the state of the
instance; a runtime exception is then thrown if setWriteLock() was previously
called on that instance.
(The previous approach still may be used in cases where it makes sense.)
So far, the following pairs of classes have been merged:
CharacterMatrix, CharacterMatrixBuffer
DistanceMatrix, DistanceMatrixBuffer
WeightVector, WeightVectorBuffer
ProteinAtom, ProteinAtomBuffer
ProteinSequence, ProteinSequenceBuffer
The following pairs of classes still need to be merged:
Tree, TreeBuffer
TreeNode, TreeNodeBuffer