[Biojava-dev] unchangeable

Schreiber, Mark mark.schreiber@agresearch.co.nz
Mon, 4 Nov 2002 09:02:26 +1300


Hi -

Another thing I noticed with annotations and forwarders is that classes
that inherit from Unchangeable don't use the Change API, which is fine.
In the documentation it suggests that it is appropriate to inherit from
this when your class is going to be immutable. Unfortunately in some
cases the class contains a perfectly mutable annotation object with no
way to register listeners for it.

Would it be a good idea to have a ImmutableAnnotation which is locked
once it is instantiated? If someone really did need to change it they
could wrap the Annotation with a OverlayAnnotation. This still doesn't
easily allow listening.

Alternatively the docs could be changed to say most things are unchanged
and provide support for anntotation changes. Not sure if similar
problems occur with features but it would seem reasonable to expect that
unchangeable objects cannot get new features.

- Mark

Mark Schreiber PhD
Bioinformatics
AgResearch Invermay
PO Box 50034
Mosgiel
New Zealand
 
PH:   +64 3 489 9175
FAX:  +64 3 489 3739

=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================