[BioC] Re: documenting S4 classes/accessors/encapsulation

Byron Ellis bellis@hsph.harvard.edu
Wed, 27 Mar 2002 13:57:13 -0500 (EST)


This always seemed sort of strange to me--we've already got foo() and
foo()<- as a perfectly good get/set mechanism. I would even argue that
this has a better visual representation than set and get since you are
forced to look for a lowercase 'set' or 'get' in commands that are
otherwise identical. There *is* a problem of complex set commands, but
I've come to think that small objects might be the solution (instead of
taking a single object type the ()<- takes some particular object type--a
coercion of sorts)


Byron Ellis (bellis@hsph.harvard.edu)
"Oook" - The Librarian

Please finger bellis@hsph.harvard.edu for PGP keys

On Wed, 27 Mar 2002, Vincent Carey 525-2265 wrote:

> one more point about accessors.  when autogenerated in the
> OOP package, last time I looked, the accessor functions
> had a prefix
> 
> for slot foo, you would get an accessor function "getFoo"
> 
> you might also get an assignment helper  "setFoo"
> 
> we MAY want to start distinguishing our accessors in this manner.
> this can be done in a backwards compatible way, by simply
> adding compliantly named slots.  we then deprecate the
> old style accessors and after a certain time, eliminate them
> from the class definition.
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor
>