config-aware widgets (was: Re: Experiences with KDE-CVS at LinuxWorldExpo)
Havoc Pennington
hp at redhat.com
Mon Nov 11 23:34:10 GMT 2002
On Mon, Nov 11, 2002 at 11:59:51PM +0100, Waldo Bastian wrote:
> >3. Change notification for KConfig keys and groups
>
> It would be a nice new feature but I don't think it is very
> important, it is not really hard to send some signals yourself if you
> need that kind of functionality.
>
My view is that change notification becomes essential if you introduce
process transparency (config options shared by several processes), but
you can live without it otherwise.
The reason it's essential then is that unless you write your code in
MVC style with the config database as M, you will use a different
codepath for the "I changed the option myself" case and the "someone
else changed the option" case, and then no one ever tests the second
codepath.
Difference between:
changeConfigOption();
updateMyAppGUI();
and:
connectSignal ("option_changed", updateMyAppGUI());
changeConfigOption();
where the second handles some other part of the code (or another
process) doing changeConfigOption(), and the first does not.
Of course the change notify is useful for code modularity even within
the same process, but is essential for multiple processes because the
app developer isn't aware of all possible C in MVC (and other
processes can't call updateMyAppGUI() without bad hacks).
Havoc
More information about the kde-core-devel
mailing list