[Biococoa-dev] why placeholder classes was: BCSequence class cluster

Charles PARNOT charles.parnot at stanford.edu
Sun Jan 9 00:51:48 EST 2005


>On Jan 8, 2005, at 8:20 AM, Alexander Griekspoor wrote:
>
>>>Again, the reason why I came up with the idea of some public headers for placeholder classes for typed sequences was to propose the user BOTH OPTIONS! (but maybe we should not).
>>That's perhaps the most important question we have to answer first indeed.
>>
>
>I still don't understand the construction with these placeholder classes. Why do we need them, next to the subclasses we already have? (this is an educational question, not a critical one ;-)
>
>- Koen.

This only applies to the class cluster design. Because the public superclass declares all the methods as valid, then all the subclasses are known by the compiler to also respond to all the methods. So we can't just use the headers of the subclass. We have to provide separate headers with a restricted set of methods. But alloc-ing these objects will actually return objects of the class cluster (hence 'placeholder' classes). The compiler is fooled. The runtime gets what is needed.
I hope the shortness makes it clearer. I can make a longer version if you want ;-)


Note that there might be other possibilities to achieve the same effect. I was thinking this morning in the car that maybe some aternate headers might still fool the compiler without the need for extra classes.


Charles


-- 
Charles Parnot
charles.parnot at stanford.edu

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

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