Re: GConf - defaults.



Michael Meeks <michael ximian com> writes: 
> 	This sounds like a good plan on the face of it.
> 
> 	However, when you consider multiple parallel installs of eg.
> gnumeric, each adding and removing keys from the database 0 with only the
> latest schema and defaults installed, it seems neccessary to have sensible
> defaults in the application as well.
> 
> 	Furthermore, if you entertain the possibility of gconf failing -
> perhaps during the runtime of the application, and thus a value not being
> available / valid - the problem is more acute: total failure, or the
> existance of a sensible default in the code.
> 
> 	Consequently, while the default in the schema appears very useful
> for administration of various sorts - it seems clear to me that defaults
> will (or should) in fact be coded into the application as well. So I would
> design a hypothetical system to do that easily myself.
> 

Right. GConf does not handle this exactly as I'd like at the
moment. My view on this is the following:

 - apps should be able to just assume the schema default will be
   found, much as they assume their Glade files or icon files will 
   be found. i.e. lack of the schema default means a broken
   installation.

 - once you can assume that, you don't need to put defaults in the 
   app code, or at least don't need to care much what they are

 - HOWEVER, I don't think GConf offers quite as robust a 
   guarantee as it should that you will definitely get the 
   schema default

 - one way you could make the guarantee more robust is something like:

     gconf_add_schema_file ("/installed/schema/file/path")

   and then the client-side library would fall back to the installed
   schema files instead of a database if gconfd can't be contacted or
   isn't returning values. This would all be transparent to the 
   app of course.

 - I think this is pretty similar to how bonobo-config works, i.e. for
   bonobo-config can't you assume that a hardcoded xmldb: default
   database definitely will exist and contain the defaults? But I'm
   not sure in practice how (as a sysadmin) you locate and manipulate
   the default database for a particular app, while I do understand
   how you locate and manipulate the schema files for a particular
   app.

 - With bonobo-config used standalone, I would suggest supporting the
   same schema format as GConf, so we can go ahead and adopt that
   format (it's a simple format intended to be human-readable); but
   bonobo-config might do something differently with the files such as
   put them in an xmldb at install time, I don't know how that would 
   work out.

 - in any case we need clear docs for app authors on how to install 
   defaults and the strength of guarantees for each system.


Havoc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]