[Cuis-dev] The Preference model

Mariano Montone marianomontone at gmail.com
Tue Apr 26 11:13:26 PDT 2022


El 26/4/22 a las 14:49, Hilaire Fernandes via Cuis-dev escribió:
> To overcome the limitation of Preference mode, we could have 
> subclasses of Preference, each specialized in one form of preference 
> model: list, free text, closure, boolean, integer, integer in an 
> interval, color, etc. Each one could be then extended in a third party 
> package with the appropriate widget to edit its content.

Or .. perhaps having a 'preferenceType' slot would do, with a Symbol 
denoting the preference type. Then it would be up to the tools to use 
that effectively.

In my PreferenceBrowser, the right widget is created following the 
Visitor design pattern.

If a Symbol for the preference type is not good enough, instead of 
subclassing Preference, you could have a PreferenceType class and 
subclasses, and tools create widgets using a Visitor.

> *Preferences. *This is where the preferences are stored. The behavior 
> is only in the class side, with two class variables. For me there is a 
> concern with the responsibilities. For example there are methods to 
> set the particular state of a Preference instance. For example 
> #forTouch. I don't think it belongs there. In short the class is a bit 
> a mess, 167 methods. *Opinion?*
>
>   * DictionaryOfPreferences - Hold the Preference instances.
>
One of the problems at the moment is that there's no way of listing all 
available preferences, as preferences can be created on the fly just 
with a symbol. I know that that flexibility is handy, but that's 
inconvenient for the tools. It would be nice if we could make it so that 
all preferences available can be listed some how.
>
>  *
>   * Parameters - Unclear. *Opinion?*
>
> The way to query the preferences is what make the class method 
> numerous in Preferences.  Worst, in the base system there are 
> Preferences methods for packages absent in the system, for example. 
> The specific preferences instances should be instantiated in these 
> packages, in the ad-hoc initialize class method, or so. *Opinion?*
>
> Querying a Preference instance with a symbol could make Preferences 
> much less cumbersome. Preferences for: #soundsEnabled, Preferences 
> value: #soundsEnabled, etc. *Opinion?*
>
> The perspective is also Preferences used by third-party Application.
>
> There is more to write but keep it for later.
>
> Hilaire
>
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220426/76f56aa0/attachment.htm>


More information about the Cuis-dev mailing list