What Is the Configuration Application Block?


The previous version of Enterprise Library's Configuration Application Block was called the Configuration Management Application Block. In Enterprise Library, the word Management has been dropped from all application blocks that had it as part of their name. There are a few reasons for this. First, configuration management is a larger discipline than this block really addresses. Second, all the application blocks provide management of some kind, so including Management as part of the name seemed superfluous.

Like the Configuration Management Application Block, Enterprise Library's Configuration Application Block is designed to ease the burden of storing and retrieving configuration information from an underlying data store and ensure the security and integrity of the configuration data. At the heart of the Configuration Application Block is the ability to decouple read and write operations for configuration data from the specifics of its underlying data store. It accomplishes this through StorageProviders, objects that transfer data between an application and a particular configuration data store (e.g., an XML file, the Windows Registry, or a database).

The Configuration Application Block also provides a simple application programming interface for performing the most common configuration tasks, like reading and writing configuration data. Retrieving configuration data, for example, only requires a single line of code. Additional methods and classes also exist to handle atypical configuration scenarios. While StorageProviders existed in the previous versions on the Configuration Application Block, some enhancements have been made to Enterprise Library's version that distinguishes it from its predecessor.

  • Transformers. Transformers are new with Enterprise Library's version of the Configuration Application Block. Transformers are objects that are responsible for transforming the data returned from a configuration store into a form that an application can use. Enterprise Library's Configuration Application Block ships with the XmlSerializerTransformer, a generic Transformer that takes configuration information and serializes/deserializes it via the XmlSerializer object.

  • Design-time capability. Configuring the previous application blocks consisted of manually editing XML files. I am certain that many developers have spent endless hours debugging applications only to find that the issue was due to an error in the configuration information. In this version, the Microsoft patterns & practices teamthe creators of Enterprise Libraryhas introduced the Enterprise Library Configuration Tool, a graphical, design-time configuration tool that is intended to be used for entering and editing an application's configuration information. This tool eliminates the burden of having to manually edit the configuration information and thus reduces the probability of configuration errors. The Configuration Tool will be examined in detail in the next chapter.

Lastly, if the needs of a particular enterprise application cannot be completely provided by the features that ship right out of the box, you can extend the Configuration Application Block by creating custom StorageProviders and Transformers. Both of these constructs are covered in detail later in this chapter.




Fenster Effective Use of Microsoft Enterprise Library(c) Building Blocks for Creating Enterprise Applications and Services 2006
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services
ISBN: 0321334213
EAN: 2147483647
Year: 2004
Pages: 103
Authors: Len Fenster

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net