Hi Martin,

Don't know how/where to implement a deprecation message that wouldn't be confusing for the end users.

FWIW if the replacement of class Original with class New is just a renaming (everything else remains the same), a situation I've dealt with a lot in the S4Vectors/IRanges/GenomicRanges infrastructure, I like to use the following pragmatic approach:

In package A:

  ## Replace Original with New in the Original class definition.
  setClass("New", ...)

  ## Define Original as an "alias" for New:
  setClass("Original", contains="New", representation("VIRTUAL"))

Then contact maintainers of packages that implement subclasses of Original that they should use New instead of Original. They can take their time because the cost of keeping the Original alias around is virtually zero.

H.

On 6/26/20 08:10, Martin Morgan wrote:
Pkg A provides a (virtual) class "Original".

Pkg B creates a derived class setClass("Derived", contains = "Original")

Pkg A would like to deprecate "Original" and replace with "New".

Any ideas on how to implement a deprecation message so that the Pkg B 
maintainer knows that their use of class Original is deprecated, but users 
aren't bothered by more-or-less incomprehensible messages on use? I guess using 
.Deprecated() somehow associated with setClass(); implementing something in 
initialize,Original-method would be too irritating to the user.

Thanks,

Martin

_______________________________________________
Bioc-devel@r-project.org mailing list
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=ZKKJsd3wTpxv3iRPiOQc8jk8ptFPwzh5TRNm8J6qDvA&s=TPnb__JeD-SoYXG79uR2hkfYDjmT6apkCdSfqyF1bKA&e=


--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to