[RsR] covrob --- some OOP-comments

Valentin Todorov v@|ent|n@todorov @end|ng |rom che||o@@t
Sat Mar 25 13:51:59 CET 2006


   >> I had S4 classes in mind, but it is not that easy to express this in 
UML:
    >> particularly, the classes Cov, Mcd, Ogk and Mest are S4 classes 
returned by
    >> the functions cov, covMcd, covOgk and covMest respectively. Most of 
their
    >> methods - show/plot/summary - are implemented for Cov or the abstract 
CovR
    >> and can be applied polymorphic on the subclasses.

    PetRd> Thank you for this clarification.

>yes, thank you, Valentin;
>that also sounds very well designed to me!

>I agree that a class treee i.e. inheritance is a very good thing
>here!
>But I still think we should  keep the  covrob(....,  method = "..")
>approach, additionally to your proposal;
>if only mainly for didactical / documentational reasons.

Completely agree. What I meant is that we do not need a wrapper for unifying 
the output by restructuring the objects returned by the different 
estimators, but rather rely on inheritance, as in the object model that I 
proposed, which builds the necessary building blocks.

------

    >> I'll provide some more computational evidence.

    PetRd> Thank you -- touché;

>But I (and most R-core members in general) think that this
>should not be taken to make a decision against using S4.
>Some parts of the *current* S4 implementation are still
>relatively slow, since most things happen on an interpreted
>level (i.e. most is written in R) instead of a compiled level
>(i.e. written in C).  But that's just a property of the current
>implementation and not an inherent property of the S4 OOP
>paradigm (so called "Function based" OOP as opposed to the other
>"Class based" OOP that C++ or Java make use of).

>I'm strongly advocating that we stay with S4 and use proper S4
>methods for the S4 classed objects {instead of adding function slots}.

I mean that the S4 implementation is ONLY twice slower and one can sacrifice 
this for the attained clarity and maintainability. With the "computational 
evidence" I want to show that the S4  version is AT MOST twice slower, ... 
but actually it looks much better.

... to be continued ...

best
Valentin




More information about the R-SIG-Robust mailing list