[Biococoa-dev] Base test

John Timmer jtimmer at bellatlantic.net
Mon Aug 16 08:34:42 EDT 2004

>> Any custom bases added to the .plist file have to be accessed with
>> + (BCSequenceDNABase *) customBase: (NSString *)baseName
>> When that's called, the dictionary within is also converted to a base
>> object.  I still need to make a method for adding a base
>> programmatically,
>> but that's just going to be 90% format validation code, so it
>> shouldn't be
>> hard.
> But how do you create the statics for these dynamically at run time?
> Because if you can, one could do the ideal "instantiate the whole thing
> from a plist setup" I dreamed out loud about in one of my last
> emails...

Well, that's it - you don't.  They're stored in a mutable dictionary (which
happens to be a static).  We could have done every base that way, but then
we're using NSDictionary's lookup table as opposed to coding our own, so
there would be speed issues for the commonly accessed bases.  I thought this
was a decent compromise - fast, direct access for all pre-defined bases,
slower but manageable access for everything customized.


This mind intentionally left blank

More information about the Biococoa-dev mailing list