How to deprecate a Class?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to deprecate a Class?

vonbecmann
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.

Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Mariano Martinez Peck
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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Marcus Denker-4
In reply to this post by vonbecmann

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?
>
often it's just moving it to the Deprecated package. (Deprecated14, does not exist yet I think). Sometimes it makes sense
to deprecate the class instatiaton methods in addition.

        Marcus


--
Marcus Denker -- http://marcusdenker.de


Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Stéphane Ducasse
In reply to this post by vonbecmann
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.
>


cbc
Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

cbc
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse
<[hidden email]> 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.

Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Mariano Martinez Peck


On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <[hidden email]> wrote:
On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse
<[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Nicolas Cellier
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 <[hidden email]>:

>
>
> On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <[hidden email]>
> wrote:
>>
>> On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse
>> <[hidden email]> 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
>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to deprecate a Class?

Noury Bouraqadi-2
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 <[hidden email]>:
>>
>>
>> On Thu, Aug 4, 2011 at 1:42 AM, Chris Cunningham <[hidden email]>
>> wrote:
>>>
>>> On Mon, Aug 1, 2011 at 12:21 PM, Stéphane Ducasse
>>> <[hidden email]> 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)