GConf
Encyclopedia
GConf is a system used by the GNOME
GNOME
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

 desktop environment for storing configuration
Computer configuration
In communications or computer systems, a configuration is an arrangement of functional units according to their nature, number, and chief characteristics. Often, configuration pertains to the choice of hardware, software, firmware, and documentation...

 settings for the desktop and applications.
Changes to this system are controlled by GConfd, a daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

. GConfd watches out for changes to the database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

, and when they are changed, it applies the new settings to applications using it. This technology is known as "auto-apply", compared to "explicit-apply", which requires users to press an OK or Apply button to make changes come into effect. The term "instant-apply" is sometimes used, compared to plain "apply".

The GConf database by default uses a system of directories
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 and XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 files, stored in a directory called ~/.gconf. GConf can also use other backends, such as a database server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...

, but XML file storage is the most common configuration.

The application gconf-editor
Gconf-editor
Gconf-editor is an application for the GNOME computer desktop environment. It can be considered the graphical equivalent of gconftool and is used to maintain the GNOME registry....

 is provided to allow users to change settings manually, but it is not usually used for end-user
End-user
Economics and commerce define an end user as the person who uses a product. The end user or consumer may differ from the person who purchases the product...

 preferences. These should be provided by the application, but hasn't in some cases, causing upset among users (see main gconf-editor
Gconf-editor
Gconf-editor is an application for the GNOME computer desktop environment. It can be considered the graphical equivalent of gconftool and is used to maintain the GNOME registry....

 article for details).

Architecture

GConf is currently based on the C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 implementation of CORBA
Çorba
Chorba , ciorbă , shurpa , shorpo , or sorpa is one of various kinds of soup or stew found in national cuisines across Middle East...

 named ORBit
ORBit
ORBit is a CORBA 2.4 compliant Object Request Broker . It features mature C, C++ and Python bindings, and less developed bindings for Perl, Lisp, Pascal, Ruby, and Tcl...

. Its architecture consists of a session daemon that initializes various sources of configuration schemas
Database schema
A database schema of a database system is its structure described in a formal language supported by the database management system and refers to the organization of data to create a blueprint of how a database will be constructed...

 on user login. Each source is based on a specific backend that translates the key and value pairs that compose the configuration database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

; the default backend is based on XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

. At this time, this is the only working backend for GConf, although an LDAP
Lightweight Directory Access Protocol
The Lightweight Directory Access Protocol is an application protocol for accessing and maintaining distributed directory information services over an Internet Protocol network...

 backend existed in embryonic form. Each source can also be set to read-only, in order to create a default basic configuration, e.g. in a corporate network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

.

The values inside the GConf database are indexed using a path
Path (computing)
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent...

 string in the form of /path/to/application/key.

The proper way to access the GConf database held by the GConf daemon is to use the GConfClient GObject
GObject
The GLib Object System, or GObject, is a free software library providing a portable object system and transparent cross-language interoperability...

-based class.

Changes notification

When writing an application that uses GConf, one should never directly poll the database. Instead, one should attach a callback
Callback (computer science)
In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software layer to call a subroutine defined in a higher-level layer....

 to a given key, thus using a Model-view-controller
Model-view-controller
Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...

 paradigm. Each time an application changes the value bound to a specific key, the notification callbacks will be invoked.

Schemas

An application using GConf should provide a description for each key it creates inside the GConf database. This configuration meta-data is also stored inside the configuration database, and is called a schema; it could contain a (possibly localized) descriptive text, the valid type of the value bound to a key, and a default value.

Bindings

Like many libraries in the GNOME
GNOME
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

 platform, GConf can be accessed using various programming languages, such as
C, C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

, Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

, Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

, C#, VB.NET and Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK