Enterprise Library Step by Step Series (15) Configure Application Block

Source: Internet
Author: User
Tags config configuration settings

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.