[Biococoa-dev] ambiguous symbols
Koen van der Drift
kvddrift at earthlink.net
Sun Nov 14 13:19:26 EST 2004
>
> There's two challenges here - one is that the nucleotides have
> complements
> and the amino acids don't, as you pointed out in the quote just below.
> A
> second is that the relationships have to be made to members of a
> specific
> subclass - ie, a BCNucleotideDNA should only complement others from its
> subclass. I'd guess you could get around this by figuring out what
> kind of
> class self is, but I don't know enough about how ObjC handles
> inheritance to
> know how well this would work - does an object know what class it is
> when
> it's executing functions in it's super?
>
> Clearly, we could just declare that method in the super and implement
> it in
> each subclass. Since you're doing the work, how are you hoping to
> handle
> it, Koen?
For now, I've left the method in the super class empty, and put all the
code in the subclasses. But I think we can at least put the code that
fills represents and representedBy in the superclass. I will check that
later. When similar code gets repeated in the various subclasses, it
definitely is a candidate to go into the super. (This was also the
reason for my plea a few weeks ago to put all the rangeOfSubsequence
methods in BCSequence only. But now that BCFindSequence is in place, we
probably can remove rangeOfSubsequence et al completely).
>
> As far as I can tell,
> there's no need to access the "Name" value in this method. The code
> should
> probably start somewhere around the line:
>
> infoArray = [baseInfo objectForKey: @"Represents"];
>
Ah, thanks. Will fix that.
>> if ([represents count] == 1)
>>
>> Is this also correct?
>
> That would work, but if we're adding the code to handle the ambiguity
> in the
> superclass, we could probably move this method up to the superclass,
> too.
I already did :)
> You may want to reverse the logic, though, as "isAmbiguous" seems
> (pardon me
> here) less ambiguous than "isSingleSymbol" in terms of method names
> that
> clearly indicate the function.
You mean to use:
if ([represents count] >1) ?
thanks for the input,
- Koen.
More information about the Biococoa-dev
mailing list