[Bioc-devel] Deprecating a class

Hervé Pagès hpages at fredhutch.org
Tue Jun 27 19:41:16 CEST 2017

Hi Carlos,

Deprecating the constructors should be enough if you don't expect that
your users have serialized instances of the class around (i.e. objects
that they saved to disk with save() or saveRDS()).

It's actually impossible to know whether your users have done this or
not but they would typically do this only if these objects take a long
time to compute or if the typical workflow that you present in your
vignette encourages this. If it's the case then the situation is a
little bit more complicated:

   - You would need to provide a coercion method from this class to the
     replacement class.

   - You would also need to put a deprecation warning in all the methods
     defined on this class (this includes validity and show methods if
     you've defined them, and also coercion methods *to* this class. The
     deprecation warning would typically explain how to coerce the
     deprecated object to the new replacement class.

Hope this helps,

On 06/27/2017 01:50 AM, Carlos Ruiz wrote:
> Hi Bioc developers,
> A year ago, we introduced a class in my package MEAL to manage
> methylation data. After some Bioc releases, we realised that we don't
> really need this class and that it is better to reuse other Bioc classes
> to facilitate package usability. Is there any protocol to deprecate a
> class? There is only a guide to deprecate functions and methods.
> For the new release, I was thinking on deprecating the constructors of
> my class, while keeping the methods. Is that OK?
> Bests,

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: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

More information about the Bioc-devel mailing list