[Meta] Standard packages?

nicolas cellier ncellier at ifrance.com
Mon Jul 23 12:55:26 UTC 2007


Damien Cassou <damien.cassou <at> gmail.com> writes:

> I'm not sure annotations are used for that kind of things:
> 
> - the preference system would have to browse all methods of all
> classes to detect these annotations
> - in which method do you put the annotation?
> - in your code, how do you access the preference? and if the
> preference system is not present, how do you code this?
> 

VW use them to hook application-dependent-items to launcher menu bar.
Which class enumerates the annotations and what event triggers the enumeration?
I do not know the implementation details...
I only know this is possible.

We should isolate generic Preference services from application packages.
My assumptions is that these services are mainly:
- reading/writing preferences in a file (IO)
- and modifying them through an interface (UI).

Basic idea is to have application preferences stored in local class variables.
Preferences could automate UI and IO given registered information:
- at least getter and setter and some basic UI (roughly like a web form)
- Some information classifying preferences are also needed for presentation,
  in order to avoid random sort in IO and UI (much like VW menus).

Preferences (un)registration can be:
- implicit: via annotations in the methods providing class/getter/setter/UIForm
- explicit: send Preferences registration messages from within MyApp initialize.
In the latter case, a Preference class MUST be in the image;
or we SHOULD protect code with something equivalent to:
	Smalltalk at: #Preferences ifPresent: [].

That's only very basic ideas.
Implementation deserves further analysis if retained.

Nicolas





More information about the Squeak-dev mailing list