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

Robert Gentleman rgentlem@jimmy.harvard.edu
Wed, 27 Mar 2002 14:07:52 -0500


On Wed, Mar 27, 2002 at 01:57:13PM -0500, Byron Ellis wrote:
> 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)


 I wasn't proposing that we have to use setXYZ and getXYZ,
  but folks from the Java community
 kinda like it that way. If it makes it easier for them then that is
 fine. There is a syntactic issue in the new regime since one uses a
 call to setReplaceMethod("foo"...), and gets back a foo<- object.
 This is a bit of a
 disconnect but probably not that important.

 r


> 
> 
> 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
> > 
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor

-- 
+---------------------------------------------------------------------------+
| Robert Gentleman                 phone : (617) 632-5250                   |
| Associate Professor              fax:   (617)  632-2444                   |
| Department of Biostatistics      office: M1B28
| Harvard School of Public Health  email: rgentlem@jimmy.dfci.harvard.edu   |
+---------------------------------------------------------------------------+