[Biojava-l] [proposal] Sequence and Feature changes.

Thomas Down td2@sanger.ac.uk
Mon, 17 Jul 2000 13:04:04 +0100


Hi...

One more pre-1.0 interface tidying proposal from me.  I promise
this will be absolutely, definitely, the last major public API
rewrite I do before the freeze.  We already have bio.symbol
interfaces which are unlikely to change again.  I hope this
set of changes will bring the bio.seq interfaces to the same
point.


Although there are significant API changes involved here, the
impact on existing code which uses the feature interfaces should
be fairly minor.  I'd be interested to hear if anyone has any
non-trivial applications which are currently using these interfaces.

Changes to Feature (should all be client-compatible):

  - Add two new get-property methods:
        public FeatureHolder getParent();
        public Sequence getSequence();

    (added to the existing getLocation(), getSource(), getType(),
    and getSymbols())

  Rationale: Features already need to have internal knowledge of
  their position within the tree of Feature objects attached
  to a Sequence.  These methods simply make these relationships
  publically accessible.


Changes to FeatureHolder:

  - Add the following methods for creation and removal of Features:
        public Feature createFeature(Feature.Template template);
        public void removeFeature(Feature f);

  Rationale: Features can now be created directly by using
  a method on the parent FeatureHolder, rather than using the
  current createFeature(FeatureHolder, Feature.Template) method
  of the Sequence interface.

Remove the current MutableFeatureHolder interface -- it's
functionality is now part of the standard FeatureHolder
(implementations may throw exceptions if they do not support
the createFeature or removeFeature methods).

These two changes should make Feature objects much easier to
create, and will allow much tidyer internal mechanisms for
creating new Feature objects and attaching them to Sequences.

Thomas.
-- 
He looked up with big brown eyes.  ``They're really only
tiny little A-bombs, honest.''
                                     -- David Brin.