[Biococoa-dev] BCSequenceRecord

Charles Parnot charles.parnot at gmail.com
Sat Jul 9 02:40:54 EDT 2005

On Jul 8, 2005, at 9:38 PM, Koen van der Drift wrote:

> On Jul 9, 2005, at 12:25 AM, Charles Parnot wrote:
>> You are suggesting to add yet another hierarchy of classes, 6  
>> total ??!?? ;-)
> Nooooooo !!!!!!  :D
>> Anyway, we already had that discussion and the bottom line was:  
>> the annotations would be just one ivar = 4 bytes when nil,  
>> slightly more when empty dictionary, which is anyway very small  
>> compared to the sequence array of char.
> I am suggesting to keep the annotations outside the BCSequence  
> class.  BCSequence is only a sequence of symbols nothing more,  
> nothing less. BCSequenceRecord (only one class, no subclasses) is  
> basically a dictionary with all the key-value pairs from a IO file  
> and has-a BCSequence. in one of the key-value pairs.
> - Koen.

OK, just one class.

But, still, your initial argument seems to be that BCSequence should  
remain a light object, hence no annotations. However, an additional  
ivar for the annotations will not make it heavier if it is set to nil.
Having more methods in the BCSequence object (to deal with  
annotations) will also not make a particular instance heavier.
Now, many methods will check for the annotations when manipulating  
the sequence (subsequences, insertions, deletions,...). But again,  
there should always be a 'if annotations==nil' to skip the annotation  
manipulations and keep the method speedy and focused on the sequence  

So I would have to first be convinced that the annotations would be  
bad to have in BCSequence, before adding yet another class. Of  
course, I have to admit Apple decided to have two classes, NSString  
and NSAttributedString, in a somewhat similar case... though the  
structure is different, NSAttributedString is a subclass, which makes  
sense because subclass methods can handle attributes while the  
characters themselves are left to the superclass. Sorry, I am just  
thinking aloud with no too much logic and structure. Just throwing  
ideas and brainstorming...


Help science move fast forward:

Charles Parnot
charles.parnot at gmail.com

More information about the Biococoa-dev mailing list