[Biococoa-dev] Base test

Alexander Griekspoor mek at mekentosj.com
Sun Aug 15 19:10:47 EDT 2004


>>  Koen, in your sequence class I saw you can init them with a string, 
>> great! But next you keep the string around and many methods depend on 
>> / work with the string. This leads to exactly the problems we 
>> discussed. Init with a string is logical of course, but then we 
>> should just let that go and completely depend on the sequence list 
>> containing John's bases. We shouldn't have to worry about keeping the 
>> string in sync here, the only string you can get back out is through 
>> the stringRepresentation; method which is generated at that 
>> particular moment back "translated" from the sequencelist. Of course 
>> I realize it is work in progress and perhaps to early.
>
> I think the only other thing I do with the string are the 2 accessor 
> functions.  Editing of the sequence is done for the NSMutableArray, 
> although this is still commented out until we agree on the naming of 
> classes.

In that case the sequence and setSequence method definitely should be 
made @private so they are only used internally. In general while 
developing a framework we should take special care to nicely 
"private-out" all internal methods to avoid people to get a bunch of 
compiler warnings (the famous: "Also found bla bla method") when they 
use our framework. Also, why the keep the string around? That only 
takes up memory and leaves you most probably with one that is pretty 
quickly out of sync with the array:

- (id)initWithString:(NSString*)aString withRange:(NSRange)aRange
{
     if (self = [super init])
     {
         [self setSequenceString:aString];   <<---
         [self setRange:aRange];

         sequence = [[NSMutableArray alloc] init];
		sequenceCountedSet = [[NSCountedSet alloc] init];
     }

     return self;
}



>> - I found the -position; method a bit confusing as to it's 
>> description vs what it does
>
> It's used by my app to make a string that displays the start and end 
> position (1-based) of a subsequence.  We can rename it.

I thought so already, either we should rename it (if we decide to keep 
the start/end position thing in) or remove it. If the positioning is 
kept, why don't we include it in the general description? I think the 
way it is now it's way to program specific, any developer might want it 
in a different way, so leave it up to them as they can access the 
integers anyway.

>> - What does the countedset do,
>
> The counted set keeps track of the number of different aminoacids, see 
> the method countAminoAcids how to populate the set.
Nice solution! The question if this is also something that we should 
move to the BCProteinUtil shared object. If we go for a strict 
separation between model (data), controller, and view (which I strongly 
am in favour of), we should move all these kind of methods outside of 
our data classes (which the sequence clearly is). That way we don't 
have to update these methods everytime we edit the sequence. The only 
advantage I see is for caching purposes but perhaps that should again 
be better left to the app developer to implement in return for a 
cleaner framework. I like the countedset method though, so just copy it 
to the shared object.

>> and is that supported from Jaguar?
>
> Not sure, the docs usually say if it is 10.3 and later, but there is 
> no such mention in the class description.

You're right, I could found the technote for 10.2 that mentioned that 
they had fixed a memory leak in NSCountedSet, guess that means it was 
there already ;-)


>> I guess before that however, many discussion will follow ;-)
>
> Amen.

LOL, well, it was still sunday when I wrote the email ;-) Oh, no it 
wasn't, now I have been lying as well, better think over my sins during 
a good night of sleep ;-)
A.



**************************************************************
                         ** Alexander Griekspoor **
**************************************************************
                  The Netherlands Cancer Institute
                  Department of Tumorbiology (H4)
             Plesmanlaan 121, 1066 CX, Amsterdam
                        Tel:  + 31 20 - 512 2023
                        Fax:  + 31 20 - 512 2029
                       AIM: mekentosj at mac.com
                       E-mail: a.griekspoor at nki.nl
                    Web: http://www.mekentosj.com

MacOS X: The power of UNIX with the simplicity of the Mac

***************************************************************




More information about the Biococoa-dev mailing list