[Biococoa-dev] more on BCCodon
Koen van der Drift
kvddrift at earthlink.net
Mon Sep 6 17:39:20 EDT 2004
On Sep 6, 2004, at 2:27 PM, John Timmer wrote:
> The problem with codons is that they don't really fit neatly into the
> defined classes. There's always a few methods in the Symbol and
> classes that don't make any sense when applied to a codon.
You don't have to use all methods that are provided by the superclass,
so I don't think it is a problem. If I know that an object is a
sequence, I will just call [mySequence sequenceString] to get an
NSString, and I don't have to worry that the method doesn't exit, or is
named differently. BCCodon now uses 'tripletString' to return an
NSString, just as it uses 'triplet' instead of sequenceArray. That's
the beauty of inheritance. I don't see any reason why to treat BCCodon
differently, to me it's a sequence of three nucleotides.
Moreover if all classes that deal with sequences use the same method
naming, it becomes much easier for users (and us) to use BioCocoa. If
every class uses a different approach, things get more unclear, and
more difficult to maintain.
> Given that, it
> seemed more useful to have a BCSequenceCodon, so I specifically avoided
> using it as a superclass. While I'm on my flights later this week, I'm
> going to try to figure out a way to squeeze them in as a subclass of
> BCSymbol, but I'm not optimistic.
What's the advantage of subclassing BCSymbol compared to BCSequence?
Again, it's a sequence, so subclassing BCSequence seems more logical to
More information about the Biococoa-dev