[Cuis-dev] [Preference] Category as domain name
Juan Vuletich
JuanVuletich at zoho.com
Tue Jun 7 11:04:26 PDT 2022
Hi Hilaire,
I'm not happy about this proposal.
I think Preferences (both old and new) have a problem. The name clashing
you see is a symptom of the problem. But the problem is having all
packages use the central Preferences mechanism.
Your proposal makes me remember the Windows Registry: A central
repository of preferences/options/configurations for all apps in the
system. It also has a hierarchical structure to support multiple users.
Some of the problems of this approach (in particular in Windows) are:
- Modifying anything there is very dangerous. A single mistake could
break the whole system beyond repair. So, everybody is really afraid of
touching it.
- Anyone could modify stuff that isn't their business at all
- When you remove an app, in many cases they leave garbage there
- Sometimes you completely uninstall an app to solve some problem, and
you reinstall it afterwards. The problem is never solved because it was
garbage left in the Registry and never cleaned. Only solution is to
format disk and reinstall Windows (and losing everything else, of course)
I think it would be much better, as Luciano also suggests, to use the
central Preference registry only for the base image, and have a good way
to let packages have their own.
Thanks,
On 6/4/2022 6:17 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi
>
> Below redesign proposals to the PreferenceNG class and its protocol:
>
> 1) In the PreferenceNG class, ThePreferences class variable is a
> dictionary of dictionaries where its keys are the category name.
>
> 2) A preference is instantiated/updated identically with the messages
> #name:description:category:type:value: and #name:category:value:
>
> 3) To access a preference instantiated in the base image, nothing change:
>
> PreferenceNG at: #color
>
> Internally PreferenceNG searches for the preference only in the base
> image preference categories: #system, #programming, #gui, #font.
>
> To access a preference in non base image category I propose the
> message #at:in: #at:in:put, #instanceAt:in:
>
> PreferenceNG at: #textSize in: #zork
>
> PreferenceNG at: #textSize in: #zork put: 12
>
> (the instantiate method can still be used to edit a preference value:
> PreferenceNG name: #textSize category: #zork value: 12)
>
> Then I propose shortcuts compatible with the existing protocol:
>
> Preference at: #zork:textSize
>
> Preference at: #zork:textSize put: 16
>
> Preference instanceAt: #zork:textSize
>
> I will have to write a method to move the preferences in their own
> category dictionaries.
>
> Comments?
>
> Thanks
>
> Hilaire
>
> --
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
https://independent.academia.edu/JuanVuletich
https://www.researchgate.net/profile/Juan-Vuletich
https://patents.justia.com/inventor/juan-manuel-vuletich
https://twitter.com/JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220607/9b9dcbc1/attachment.htm>
More information about the Cuis-dev
mailing list