Skip to content

[Bioc-devel] Deprecating a class

2 messages · Carlos Ruiz, Hervé Pagès

#
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,

-- 
Carlos Ruiz
PhD Student
ISGlobal
Barcelona Institute for Global Health - Campus MAR
Barcelona Biomedical Research Park (PRBB) (office 001)
Doctor Aiguader, 88
08003 Barcelona, Spain
Tel. +34 93 214 7309
carlos.ruiz at isglobal.org
www.isglobal.org

We are pleased to tell you that after three years of a strategic alliance between ISGlobal and CREAL, both institutions have merged. The resulting institution, which retains the ISGlobal name, will build upon the existing areas of excellence to become a world-class player in research, education and innovation in Global Health. More info at: http://ow.ly/krQd301Nj3w

  

This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by professional privilege. If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.

DATA PROTECTION. We inform you that your personal data, including your e-mail address and data included in your email correspondence, are included in the ISGlobal Foundation files. Your personal data will be used for the purpose of contacting you and sending information on the activities of the above foundations. You can exercise your rights of access, rectification, cancellation and opposition by contacting the following address: lopd at isglobal.org. ISGlobal Privacy Policy at www.isglobal.org.
#
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,
H.
On 06/27/2017 01:50 AM, Carlos Ruiz wrote: