[Cuis-dev] The Preference model
Mariano Montone
marianomontone at gmail.com
Thu Apr 28 06:47:46 PDT 2022
El 28/4/22 a las 10:24, Mariano Montone escribió:
> El 28/4/22 a las 06:13, Hilaire Fernandes via Cuis-dev escribió:
>> Using PreferenceType I fail to understand how it will reduce the
>> quantity of needed classes to represent the whole model: a hierarchy
>> of Preference or a hierarchy of TypePreference. The advantage of the
>> former approach, the code is easier to understand as the behavior is
>> concentrated in one class.
>
> What I'm proposing is no hierarchy at all. Neither for Preference or
> PreferenceType.
>
> I'm proposing adding a 'preferenceType' instance variable to
> Preference, and bind that to Smalltalk classes, like Boolean, String,
> Integer, Color. Or instances of Array for list of options. Or
> something else that can be handled by some tool.
90% will have those types. If some package wants to use a more complex
property type, it just creates a class modeling the preference type and
assigns an instance of that class to 'preferenceType' instance variable
in Preference . I don't see the need to have a Preference subclass for
String, Boolean, etc.
>
> Then it is up to the tools then to use that information for building
> widgets the way they like.
>
>
> Mariano
>
More information about the Cuis-dev
mailing list