A draft for a standard for desktop configuration
bastian at kde.org
Tue Sep 13 11:13:06 EEST 2005
On Tuesday 13 September 2005 01:50, Jamie McCracken wrote:
> Dave Cridland wrote:
> >>It can cause there's a local daemon present. The config system is
> >>like a traditional three tier client server database application
> >>where the clients (think GConf/KConfig) are very very thin, the
> >>middleware is a thicker daemon (which does all the validation and
> >>schema handling) and the backend is just a local database or a
> >>remote one or LDAP etc. Its a tried and tested design that is
> >>commonly used in enterprise software (like J2EE).
> > Except that the application already has to do validation and defaults.
> Ah but we need to prevent garbage in the backend else we would not be
> able to serialize the variant in the first place. So first and foremost
> read and write validation is alreay happening automatically in the
> daemon whenever you load/save a value (and we cant turn it off!). If
> type mismatches occurs there then we cant serialize and the app wont be
> able to access the value - its as simple as that.
But there is no reason the daemon has to do that, the application can do it
just as well. The application has to do some sort of validation anyway,
because with validation in the daemon it still needs to check that whatever
type it gets from the configuration system matches with what it needs and
> For example if I request the value of a rect (IE a struct containing 4
> ints) the daemon will need to read this from a DB as a string (say comma
> delimited as "1,2,3,4") and also read the type signature from the schema
> (for a dbus variant you need the type signature) then serailize that
> string into a struct containing four ints (which basically means passing
> the variant four ints to serialize). If the data from the DB did not
> contain four ints then we would not be able to serialize it ergo we
> would return an error instead of a rect.
If you let the application handle this then you don't need to read the schema
because the application already knows that it needs a rect. The schema is
useful for third party tools like GConfEdit because it makes the assumptions
that the application has about the config entries explicit. The application
shouldn't need the schema itself.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20050913/20a7a3ed/attachment.pgp
More information about the xdg