[Biococoa-dev] More on BCSymbolSets

John Timmer jtimmer at bellatlantic.net
Sun Mar 6 09:16:23 EST 2005

> On Mar 6, 2005, at 1:27 AM, Charles PARNOT wrote:
>> OK, that works well for BCSequence, but how about that code:
>> BCSequenceDNA *dna=[BCSequenceDNA initWithString:@"ATGTTTGAT"
>> symbolSet:proteinSymbolSet];
> My understanding of the whole new BCSequence construction, is that the
> user only needs to use BCSequence. The framework will deal with its
> subclasses if needed. So in that case, the above would change to:
> BCSequence *dna=[BCSequence initWithString:@"ATGTTTGAT"
> symbolSet:proteinSymbolSet];
> which returns a protein object, named 'dna'.
> Can we prevent the user making such ambiguous situations, maybe by
> making the BCSequence subclasses private? Or will that break things?

Don't know if it would break things, but Alex and I would be disappointed if
they got made private, and I find it hard to believe that we'd be the only
ones who want to work that way.  Anyway, the point that Charles is trying to
make (I think) is that symbol sets open up a new set of options for having
things winding up internally inconsistent, and we need to police that.  In
this case, specifically, we need the init method of subclasses to ensure
that the symbol set they've been handed is of the appropriate type - very
simple, a line of code.

The more significant question is what should be returned.  Nil?  an error?
Use the default symbol set for that sequence type instead? Go 10.3 only and
throw an exception?

My vote would be to fall back to the default if we get anything non-sensical
handed to us.

This mind intentionally left blank

More information about the Biococoa-dev mailing list