Thanks!

Ended up implementing SequenceBuilder from scratch rather than subclassing SequenceBuilderBase, but now it works nicely.

Christian


----- Original Message ----- From: "Thomas Down" <[EMAIL PROTECTED]>
To: "Christian Storm" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 16, 2004 3:54 PM
Subject: Re: [Biojava-l] Adapting org.biojava.bio.seq classes to an interface?




On 16 Dec 2004, at 12:35, Christian Storm wrote:

Is there a way of adapting org.biojava.bio.seq classes / interfaces to an interface?

I would like to add functionality to some of the interfaces in org.biojava.bio.seq, i.e. sequence and feature, by adapting them to an existing interface.

I see two possibilites - a class adapter:

OwnSequence extends SimpleSequence implements NewFunctionality

or an object Adapter:

OwnSequence implements Sequence, NewFunctionality

Unfortunately both approaches would mean massive recoding of the parsing /building process of sequence-objects, so that in essence it would be simpler for me to write my own classes to handle sequences.

Hi Christian,

The BioJava sequence model was written with the possibility of dropping in new implementations in mind, and it certainly ought to be possible to do this -- whatever approach you choose to take -- without having to rewrite things like parsing code. A good place to start looking is the SequenceBuilder interface, which receives events from the parsing framework and constructs Sequence objects. By developing a new implementation of this, you'll be able to use any of the BioJava parsers. Depending on the exact details of your new Sequence implementation, you'll quite possibly be able to get away with a very small subclass of SequenceBuilderBase.

         Thomas.


_______________________________________________ Biojava-l mailing list - [EMAIL PROTECTED] http://biojava.org/mailman/listinfo/biojava-l

Reply via email to