[Biococoa-dev] BCSequence init methods

Koen van der Drift kvddrift at earthlink.net
Sat Feb 5 16:37:13 EST 2005


On Feb 5, 2005, at 8:07 AM, Koen van der Drift wrote:

> However, I thought that one of the benefits of the class cluster 
> approach would be that we can just use BCSequence transparantly 
> without having to worry about which subclass we are dealing with. 
> Maybe I still don't understand your approach, could you comment on 
> this?
>

OK, I think I know why this happens. In this case:

BCSequence  *theProtein = [[BCSequenceFactory sharedSequenceFactory] 
sequenceWithString: aString];

the BCSequenceFactory actually returns a BCAbstractSequence object, not 
a BCSequence, so that will cause the warning.


In the other case:

NSArray *translation = [BCToolTranslatorDNA translateDNASequence: 
theSequence usingGeneticCode: BCUniversalCodeDNA];

[BCToolTranslatorDNA translateDNASequence:] is expecting a 
BCSequenceDNA instead of a BCAbstractSequence. That one is easily 
fixed, and I will commit that. But I am not sure how to fix the first 
warning.


If there is no objection, I will also make BCToolTranslatorDNA work 
like the other BCTool subclasses, using the initWithSequence, 
doSomethingWithSequence pattern.

- Koen.




More information about the Biococoa-dev mailing list