[Biojava-l] Immutable objects and ChangeListeners
Forsch, Dan
dorsch@netgenics.com
Tue, 9 Jan 2001 18:49:05 -0500
I like the listener/event paradigm which is extremely common in "modern"
Java programming. Observer/Observable is lightweight but it doesn't provide
enough semantics.
However, I think Mark raises a fair question which I would recast thusly:
does BioJava need its own change notification API when mechanisms for this
already exist in the core Java libraries? I'm thinking specifically of the
beans PropertyChange classes. BioJava's ChangeEvent stuff has some nice
features like the ALWAYS_VETO listener and the ChangeForwarder mechanism for
chaining change events. It also unifies the bound and constrained
properties into one change framework which I feel makes it a somewhat better
API than PropertyChange/VetoableChange.
Even so it replicates about 75% of what's already built into Java as a
standard API which makes BioJava less compatible with external code,
especially (but not limited to) GUI apps and JavaBeans. I believe it would
have been possible to add some of the ChangeEvent features as extensions to
PropertyChange. The result might have been a little less clean and somewhat
constrained (heh) in terms of functionality but it would have gone a long
way to making BioJava compatible with Java standards.
I'm interested in hearing others thoughts on this with the possiblility of
looking to move the changeable support to an extension of
PropertyChange/VetoableChange following the 1.1 release.
I was further wondering if some of the "missing" implementations of
Changeable, particularly in some of the Simple... implementations like
SimpleSequence, should be filled in. Is there any support for adding this
to the To Do list for 1.1?
Dan Forsch, Principal Software Engineer
NetGenics, Inc.
1717 East 9th Street, #1600
Cleveland, OH 44114
phone: 206.374.4541
-----Original Message-----
From: Mark Schreiber [mailto:mark_s@sanger.otago.ac.nz]
Sent: Tuesday, January 09, 2001 1:07 PM
To: Matthew Pocock
Cc: biojava-l@biojava.org
Subject: Re: [Biojava-l] Immutable objects and ChangeListeners
As a bit of a biojava newbie I was wondering why the event type model was
used for the change listeners and not the observer / observable API??
Mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark Schreiber Ph: 64 3 4797875
Rm 218 email mark_s@sanger.otago.ac.nz
Department of Biochemistry email m.schreiber@clear.net.nz
University of Otago
PO Box 56
Dunedin
New Zealand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Biojava-l mailing list - Biojava-l@biojava.org
http://biojava.org/mailman/listinfo/biojava-l