[Pharo-project] How to deprecate a Class?
Hi all, In the issue tracker, there are many issues to deprecate several classes. so, What do you do in order to deprecate a class? Could you explain the procedure to deprecate a class? Thanks.
This is not easy. So far I saw several things: 1) move the class to a package Deprecated12 or Deprecated13 or whatever pharo version. 2) Nuke the class: empty the method dictionary. That way, you can load code that use such class but you will have lots of dnu at runtime I am not sure which is the desired behavior now. Of course, a correct way to deprecate classes would be awesome, but I guess it is not that easy. On Mon, Aug 1, 2011 at 8:18 PM, Bernardo Ezequiel Contreras < vonbecmann@gmail.com> wrote:
Hi all, In the issue tracker, there are many issues to deprecate several classes. so, What do you do in order to deprecate a class? Could you explain the procedure to deprecate a class?
Thanks.
-- Mariano http://marianopeck.wordpress.com
The most important aspects is that there is not reference to it. and that if we replace it by something else, it works. After we can write in the comments in big that the class is deprecated. Stef On Aug 1, 2011, at 8:18 PM, Bernardo Ezequiel Contreras wrote:
Hi all, In the issue tracker, there are many issues to deprecate several classes. so, What do you do in order to deprecate a class? Could you explain the procedure to deprecate a class?
Thanks.
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
The most important aspects is that there is not reference to it. and that if we replace it by something else, it works. After we can write in the comments in big that the class is deprecated.
Could you (we) also deprecate all the methods in the class? Ideally in some automated way, of course.
On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <cunningham.cb@gmail.com>wrote:
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
The most important aspects is that there is not reference to it. and that if we replace it by something else, it works. After we can write in the comments in big that the class is deprecated.
Could you (we) also deprecate all the methods in the class? Ideally in some automated way, of course.
Or remove all methods and implement doesNotUnderstand: ^Error new signal: 'All mehtods of this class are deprecated, please use ....' hehheheh :) -- Mariano http://marianopeck.wordpress.com
Why not make this class a factory in the interim ? DeprecatedClass class>>new self deprecated: 'DeprecatedClass use BrandNewClass instead'. ^BrandNewClass new 2011/8/4 Mariano Martinez Peck <marianopeck@gmail.com>:
On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <cunningham.cb@gmail.com> wrote:
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
The most important aspects is that there is not reference to it. and that if we replace it by something else, it works. After we can write in the comments in big that the class is deprecated.
Could you (we) also deprecate all the methods in the class? Â Ideally in some automated way, of course.
Or remove all methods and implement
doesNotUnderstand:
   ^Error new signal: 'All mehtods of this class are deprecated, please use ....'
hehheheh :)
-- Mariano http://marianopeck.wordpress.com
I'd rather use trait. Note that in both cases, subclasses will be made deprecated too. Noury On 4 août 2011, at 10:17, Nicolas Cellier wrote:
Why not make this class a factory in the interim ?
DeprecatedClass class>>new self deprecated: 'DeprecatedClass use BrandNewClass instead'. ^BrandNewClass new
2011/8/4 Mariano Martinez Peck <marianopeck@gmail.com>:
On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <cunningham.cb@gmail.com> wrote:
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
The most important aspects is that there is not reference to it. and that if we replace it by something else, it works. After we can write in the comments in big that the class is deprecated.
Could you (we) also deprecate all the methods in the class? Ideally in some automated way, of course.
Or remove all methods and implement
doesNotUnderstand:
^Error new signal: 'All mehtods of this class are deprecated, please use ....'
hehheheh :)
-- Mariano http://marianopeck.wordpress.com
Noury Bouraqadi http://car.mines-douai.fr/noury -- -19èmes Journées Francophones sur les Systèmes Multi-Agents (JFSMAâ11) http://www.univ-valenciennes.fr/congres/jfsma2011/ 17-19 Octobre 2011, Valenciennes, France -5th International Conference on Smalltalk Technologies http://www.fast.org.ar November 3th - 5th, 2011 Universidad Nacional de Quilmes (Argentina)
participants (6)
-
Bernardo Ezequiel Contreras -
Chris Cunningham -
Mariano Martinez Peck -
Nicolas Cellier -
Noury Bouraqadi -
Stéphane Ducasse