[Biococoa-dev] (no subject)
Charles Parnot
charles.parnot at gmail.com
Mon Jul 4 16:03:32 EDT 2005
On Jul 4, 2005, at 1:01 AM, Philipp Seibel wrote:
>
> Am 04.07.2005 um 07:48 schrieb Charles Parnot:
>
>>> There is a structural failure in our implementation, the user
>>> thinks he will get a BCSequence object, when he calls a init or
>>> convenient method of BCSequence, but he gets a
>>> BCAbstractSequence. So we have to fix the inheritance model.
>>
>> Hi Phil,
>> Can you clarify this? I don't understand what you mean :-)
>>
>
> Hey Charles,
>
> Sure. We have to make one class out of BCSequence and
> BCAbstractSequence, i would suggest to name it BCSequence.
> And now to the big "WHY??":
>
> The problem is, that a user writes in his code:
>
> BCSequence *seq = [[BCSequence alloc] initWithString:anySeqString];
>
> seq will be for example of type BCSequenceRNA, but BCSequenceRNA
> doesn't inherit from BCSequence.
> Objective-C allows our current implementation, but it is a
> structural failure. We need to subclass the BCSequenceNucleotide
> etc. from BCSequence and put the code of BCAbstractSequence in
> BCSequence.
I don't see why BCSequenceRNA *has* to inherit from BCSequence. Like
you say, the implementation works fine and is transparent to the
user. You choose to use a BCSequence object that can respond to all
messages and be any type of sequence. Or you choose to work with a
typed class, e.g. BCSequenceRNA, that only responds to nucleotide-
specific messages (at least from the comppiler point of view).
> It's hard to explain, the easiest thing is to look at the NSValue &
> NSNumber implementation of GNUStep.
> If you looked at the implementation and then read my message
> again ;-) you will hopefully understand.
I think there is a misunderstanding, then! The BCSequence is *not* a
class cluster. NSValue and NSNumber are class clusters.
I believe you will have more questions following that, but I will
just wait for them instead of trying to address everything now ;-)
charles
--
Xgrid-at-Stanford
Help science move fast forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford
Charles Parnot
charles.parnot at gmail.com
More information about the Biococoa-dev
mailing list