On Tue, Apr 28, 2009 at 9:15 AM, Alain Plantec <[email protected]> wrote:


> If I well understand, the problem is as follow:
> You have a preference which value is a class (InputSensor).
> The problem is that the class InputSensor can be removed or changed,
> letting your preference value
> point to AnObsoleteInputSensor. You would like to be warned that
> InputSensor is used as a preference value
> when you're about to remove that class.
> Do I understand well ?

Yes and no. ;-)
I don't think classes should be referenced directly as preference
values, but that is a different discussion.

In my case it was the changeInformee inst var that pointed to that
class. And that inst var can only be set programmatically. But, there
is no code in the system that does that anymore.

> For such a situation, the new setting package can provide the
> initialization code you would like with the help of a SettingStyle.
> A SettingStyle only responsibility is to provide a load method which,
> when evaluated, re-generates
> settings.
> We could have a "current" SettingStyle always up-to-date and which would
> be automatically changed (generating of the load method)
> every time a setting value is changed. Of course, then, a simple setting
> change would be time consuming
> but I guess this is not very important because settings are set rarely.
>
> what do you think ?

I think that would be overkill. Preference initialization code doesn't
need to be able to create the current settings, only a default set of
settings.

But your proposal have me a different idea how to solve the problem
for preference values:

For references to objects or classes in the value entry it would help
to have the class reference search also go through the preference
values. That way you would get informed of references to a class from
preferences before removing the class.
There are probably other well known locations that should be checked
(e.g. Object Dependents).

Michael

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to