[Biococoa-dev] Base design
John Timmer
jtimmer at bellatlantic.net
Thu Aug 12 08:31:20 EDT 2004
>
> I am not sure what this class would do. Is it to represent a sequence
> of bases, or is it to represent one base? Maybe we should start with
> the abstract BCSequence class, and the implementation of the singleton
> pattern for symbols. After that we can write the various subclasses,
> etc.
Okay, I learned a couple of things by trying them out last night, and I've
got a clearer idea of what I'm going to try to do.
The basic ideas are two-fold: convenience and readable code. For
convenience, I've created a sort of "super-header", BCSequenceDNABases.h.
Importing this will in turn import all the individual base headers.
BCSequenceDNABase is going to be the abstract class. The readability factor
comes from being able to take any object and do:
if ( [anObject isKindOfClass: [BCSequenceDNABase class]] ) etc.
Instead of having to test for each individual class, or make assumptions
about responding to selectors and such (incidentally, I'm assuming the
runtime system handles generating unique class IDs - if I'm wrong, please
let me know).
I was going to leave the class more or less empty, but then I realize I
actually have to fill it with empty methods in order to suppress compiler
warnings.
Given that I have to put methods there, I think I'm going to move all the
singleton generation methods into the base class. I think (though I'm not
positive), that it'll be simpler to call
[BCSequenceDNABase adenine];
[BCSequenceDNABase thymidine];
Than having to call a different class for each base.
I should have an example coded with ATCGN before the end of the day, at
which point it'll be easier for you to tell me what I've done wrong ;).
John
_______________________________________________
This mind intentionally left blank
More information about the Biococoa-dev
mailing list