VASmalltalk – 8.5 – “Deprecation Exception support”

One of new feature is the “Deprecation Exception support”.

This feature allows Instantiations (or for your own frameworks) to tell the users (programmers), that using a special method is not a good idea any more.

When looking for a new feature one might get the idea to ask the documentation, but when asking the documentation you get only an indirect hint, where to look for. You get the documentation how to configure the Deprecation support (“Kernel stanza”) in your “ini”-file, but no direct information, how the stuff is working.

In the “ini”-file you may configure what to do, when such an exception is signaled. You have several choices here:

* log information about using this method in a memory structure
* raise exception – shows a dialog, when execution such an exception
* show – prints a line via Transcript.

when reading this documentation you get the final hint where to look for: class “Deprecation” is your friend.

Ok – when calling such deprecated methods an exception is signaled. Marking a method as deprecated is simple. Just insert a “self deprecated” or “self deprecated: explanationString in: versionString” statement in this method.

As an example in VASmaltalk 8.5:

EmSystemConfiguration>>vaVersion
vaVersion
  self deprecated: 'Use #imageVersion instead' in: 'V8.5'.
  ^ self imageVersion

For this feature I have some wishes:

* a new feature should always be found and described in the product documentation
* add a rule for Smalllint to find the usages of these method
* or perhaps a simple list GUI showing methods sending those methods

This entry was posted in Smalltalk and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s