An analysis about a generic desktop application configuration management system
Avery Pennarun
apenwarr at nit.ca
Thu Apr 7 23:02:49 EEST 2005
On Thu, Apr 07, 2005 at 08:44:34PM +0100, Dave Cridland wrote:
> Agreed that only backends need to worry about the network. But isn't
> that what network transparency means? That the applications consuming
> the configuration data don't need to know it's held on the network?
>
> Any reasonably designed API should shield the application from the
> internals, though, but it's still a valid and important point. Just
> one I can't see how we could get wrong, now, with the prior art.
It's fantastically easy to screw up network transparency. This is why the
authors of dbus have been afraid to try it with dbus - they've screwed it up
before. (In fact, making dbus network transparent would be quite sensible
compared to, say, making CORBA network transparent. But once bitten, twice
shy :))
In a config system, the problem comes down to this: nobody wants an
"asynchronous get" command in their config system, because it turns simple
things like "what colour should I make this widget" into a multi-line
callback/state machine nightmare. But if you're querying the network, you
have to be asynchronous, because it could take an undefined amount of time
for the answer to come back, and you can't afford to freeze your app in the
meantime. Threads don't help, because *all* the threads want to know things
about the configuration.
Super tricky. I think UniConf does it the right way, but you really have to
be careful about what you cache and when, etc.
> In a perfect world, the configuration system itself could perform
> version control, in effect, but none of them do as far as I know.
> (I'd not be surprised if Avery told me that UniConf can, though.)
I see you're noticing the pattern :)
In fact, UniConf doesn't currently do anything about version control.
However, someone wrote a nice app for GConf (unfortunately I forgot the
name) that does version control with a friendly UI. Because you can connect
to UniConf via GConf, this app will of course also work with UniConf and all
your favourite UniConf backends.
To do good version control, all you really need are good notifications.
Then you log them somewhere and you can play them back later. The UI for
this is the hard part, because if you don't have a good UI, nobody will use
it. The GConf app I mentioned seems pretty decent in this respect.
So in short, don't worry about solving this problem. Just make sure your
notification system works.
Have fun,
Avery
More information about the xdg
mailing list