Overview
The configuration Application Block provides a common configuration management solution for application systems that can easily read configuration information from a variety of stores. Designed to provide a simple interface for reading/writing configuration data, which separates the read and write of configuration data from the storage of data. Use storage Provider and transformers to pass data between application and physical storage while generating Provider data in an abstract abstractfactory pattern. Let's explain two important concepts that are used in configuring the Application Block:
Storage provider is an object that reads and writes to a physical store, such as an XML file or a SQL database
Transformers is the object that transforms the configuration data between the storage format and the applied format
Structural Design
The following illustration shows the relationship between the classes and objects that make up the configuration Application block. The diagram assumes that you are using an XML file Store provider and a converter that is contained in an application block. The XML File Store provider stores configuration data as a file. (Other providers use other forms of storage, such as the Windows registry.) The Xmlfilestorageprovider object points to a file that contains configuration settings for a specific configuration section. The Configurationbuilder object points to a file that contains configuration metadata for a specific configuration section. Typically, the file name that contains the configuration metadata is app.config (for windows-based applications) or web.config (for web-based applications).
Configuring the Application Block separates the configuration metadata from the actual configuration settings. The application Block places the metadata in its own file, which is independent of the location where the configuration settings are stored. Configuration settings are grouped and called configuration sections. Each Enterprise Library application block used by an application has its own configuration section, which is stored in its own file. Configuring the Application Block uses configuration metadata to access data in the configuration.
The metadata points to the Configuration Storage location and contains information, such as the types of converters and storage providers needed to configure the Application Block read/write configuration data. The configuration metadata file is divided into sections. Each section contains the information that is required to read/write a specific set of configuration settings at the Configuration Storage location. The following illustration shows the relationship between the metadata and the configuration area: