[Bioc-devel] prada package and eSet in Biobase

Seth Falcon sfalcon at fhcrc.org
Thu Apr 13 23:55:06 CEST 2006

Hi Martin,

Our posts crossed on the wire :-)

Martin Morgan <mtmorgan at fhcrc.org> writes:
> It would be fine to define the validation function in the
> class. Sometimes the validity checking function is useful in other
> circumstances, and it would then be less convenient to access and
> reuse it.

I think re-use/convenience is a separate issue.  For example:

myAllPurposeValidity <- function(object) {...}

setClass("FOO", ..., 
         validity=function(object) myAllPurposevalidity(object))

> The problem is exactly the one you noted above: it is not unreasonable
> to expect that a user (or developer of Biobase) might want to alter an
> object in several steps:
> myFancyFunction <- function(obj) {
>   assayData(obj) <- fancyAssaydData # obj invalid...
>   phenoData(obj) <- justAsFancyPhenoData # but now valid
>   validObject(obj)
>   obj
> }
> This would not be possible if validity were checked at each
> replacement. Probably it would encourage developers to access slots
> directly, and this would be very bad when the underlying reprsentation
> of the class changed. 

Good point.

More information about the Bioc-devel mailing list