[Biojava-l] Changeable change

Matthew Pocock matthew_pocock@yahoo.co.uk
Tue, 23 Apr 2002 12:51:48 +0100


Hi all,

The changeable framework is our friend but can potentialy lead to 
networks of listeners being allocated for events that can never be 
fired. I propose that we add a method to Changeable to allow 
introspection of properties that will never change, and update 
ChangeSupport so that it can manage these unmodifiable propperties for 
you (including dropping useless listeners silently). This fits with the 
"if you can't tell that it happened, it didn't" philosopy of the current 
event system quite nicely.

The changes would be:

Changeable:

   // this change type and all descendants there-of can never under
   // any circumstance be thrown by this instance
   //
   // this is not a temporarily locked value (e.g. by adding
   // a veto everything listener)
   boolean isUnmodifiable(ChangeType ct);

ChangeSupport:
   isUnmodifiable convenience implementation

   // new ChangeSupport that can never raise this set of event types
   ChangeSupport(Set unmodifiableChangeTypes);

   // modify add/remove listener to check types against isUnmodifiable
   // and silently not register listeners

Scream now or for ever hold your peace.

Matthew

ps this will not be back-ported to the current release branch