[Biococoa-dev] BCSequenceFactory removed

Charles PARNOT charles.parnot at stanford.edu
Sun Feb 13 02:25:48 EST 2005


>Excellent job. So, is the whole transformation to the class cluster done, or are there still things that do not work? Maybe we can start to add convenience methods for the BCTools classes? Should they go into the appropriate subclasses, or only in BCAbstractSequence?
>
>Next I guess is the annotation class, and then adding more code to the reader/writer classes.
>
>- Koen.

The placeholder class should work OK at runtime. It may still give compilation warnings if using methods not in the header.

When adding public methods to the the subclasses, here are the 'rules':
* the superclass should implement the method no matter what:
   - if it is relevant for all subclasses, then the returned value will be something real
   - even if relevant only for one subclass,
      the superclass should return something,
      like an empty sequence or empty array,
* the superclass does not have to have the method in the header,
    if it is not relevant for some of the subclasses
* the subclasses can override the superclass if necessary
* the subclasses can have the method in the hearder, if relevant
* BCSequence does not need to implement anything,
   because such code would never be called,
   but SHOULD have it in the header

About convenience methods. For instance, in the case of translation, you would probably implement it in the superclass with something like:
- (BCSequence *)translate
{
  BCToolTranslator  *tool=[BCToolTranslator translatorToolWithSequence:self];
  return [tool result];
}

and have the method only declared in BCSequence header (and BCSequenceDNA maybe?).

and have the following in BCSequenceDNA header and implementation:
- (BCProtein *)translateToProtein
{
  BCToolTranslator  *tool=[BCToolTranslator translatorToolWithDNASequence:self];
  return [tool result];
}

and then the tool have to have the appropriate methods too.

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