[ENH] Deprecation
Stephane Ducasse
ducasse at iam.unibe.ch
Mon May 12 09:50:06 UTC 2003
Introduce a Warning exception, Deprecation, to manage the deprecation
of methods and classes from the image.
Added deprecated:explanation: to provide some explanation if necessary.
Remove the others (the ones without explanation because as a client I
deserve comments and explanation"!
From the class Deprecation
This Warning is signalled by methods which are deprecated.
The use of Object>>#deprecatedExplanation: aString and
Object>>#deprecated: aBlock explanation: aString is recommended.
Favor deprecated:explanation: with a block calling the deprecated
method. This way old client just have to proceed to get their code
running.
Idiom: Imagine I want to deprecated foo
foo
^ 'foo'
I can do
foo
self deprecatedExplanation: 'The method oldMethod was not good. Use
Bar>>foo instead'
or better I rename foo as fooDeprecated
fooDeprecated
^ 'foo'
foo
^ self deprecated: [self fooDeprecated] explanation: 'The method
oldMethod was not good. Use Bar>>foo instead'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KCP-0063-DeprecationFromBrent.6.cs
Type: application/text
Size: 2393 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030512/dda229df/KCP-0063-DeprecationFromBrent.6.bin
More information about the Squeak-dev
mailing list
|