[Biococoa-dev] Subclass organization

Charles PARNOT charles.parnot at stanford.edu
Thu Feb 24 12:21:32 EST 2005


>I see that Koen (probably long ago) put the ambiguous amino acids in place.
>That means that all subclasses of BCSymbol now have ambiguity.  That, in
>turn, means that the method "isSingleBase" can be moved to the BCSymbol
>class, and renamed to reflect its more broad applicability.  I could either
>do "isSimpleSymbol" or "isCompoundSymbol" accordingly.  Any preferences or
>alternate suggestions?

isCompoundSymbol: maybe more technical but also more precise than 'simple', so I like it better.



>Incidentally, this will allow me to get rid of the last warning in the
>BCSequenceNucleotide class I'm putting together ;).  The flipside is that
>I'm sure it'll break code somewhere else...

Ah, ah! Time for me to commit the test bundle and then no more such worries.
Nobody answered my poll about the unit testing (snif), so I will take the absence of answers as a yes. This is democracy!


>[[self class] sequenceWithSymbolArray: theArray];
>
>Since the method's actually going to be called on a subclass, I figure this
>should generate the appropriate one. Is that accurate?
>
>Cheers,
>
>JT

Since I 'cleaned' the sequence classes initialization methods, it is actually already in the superclass BCAbstractSequence, so you get it for free for your class!!

+ (BCAbstractSequence *)sequenceWithSymbolArray:(NSArray *)entry
{
	return [[[[self class] alloc] initWithSymbolArray:entry] autorelease];
}

Subclasses only need to overwrite the two designated initializers. I put some comments about that somewhere I believe (note that with the symbolSet -Koen!-, even this should disappear soon; having 2 designated initializers is not a good design anyway!). But the subclasses of BCSequenceNucleotide already implement them, so you probably don't need to do anything at this level. Not doing anything is probably also the best way to not break anything ;-)

charles

-- 
Help science go fast forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford/

Charles Parnot
charles.parnot at stanford.edu

Room  B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)

Tel +1 650 725 7754
Fax +1 650 725 8021



More information about the Biococoa-dev mailing list