[Biococoa-dev] Sequence Structure

Charles Parnot charles.parnot at gmail.com
Wed Jul 13 11:30:21 EDT 2005

> My concern is that the caching will potentially increase the size  
> of the object enormously. If we build in the caching in the  
> accessor, even an internal call could invoke caching without the  
> user knowing. This can be pretty dangerous in terms of killing  
> performance and ram requirements. I would propose to have methods  
> to control caching actively, including a method to clear the  
> cache... What do you guys think?
> Alex

We should only do the caching for the immutable object. For the  
mutable one, it does not make much sense. If the user needs the  
symbol array all the time while changing the sequence string, AND  
needs performance, the final application is doomed anyway ;-)

Then caching on the immutable sequence is trivial. It can be done in  
the accessor. To avoid memory issues, we could set an arbitrary  
threshold above which no caching occurs.

ABout the sequenceData ivar (probably better to keep the name a bit  
longer, 'data' would really be too generic, in my opinion; and who  
knows, maybe later we will need another 'xxxData' ivar), I would type  
it to a NSMutableData in the interface. And then, in the init method,  
create an NSData (we might need just one cast there). This way, we  
won't get compiler warnings in the methods for the mutable class  
(otherwise we would have to cast the NSData into an NSMutableData in  
too many places).

Have fun coding! BTW, we have to  solve the Xcode 2/2.1 issue.


Help science move fast forward:

Charles Parnot
charles.parnot at gmail.com

More information about the Biococoa-dev mailing list