Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - 70-551, 70-552, 70-553 Section I, Part II - Configuration Management
Phil Denoncourt's Technology Rants
 
 Monday, January 30, 2006

UPGRADE: MCAD Skills to MCPD Web Developer by Using the Microsoft .NET Framework
UPGRADE: MCAD Skills to MCPD Windows Developer by Using the Microsoft .NET Framework
UPGRADE: MCSD Microsoft .NET Skills to MCPD Enterprise Application Developer by Using the Microsoft .NET Framework: Part 1


Embed configuration management functionality into a .NET Framework application. (Refer System.Configuration namespace)

  • Configuration class and ConfigurationManager class
  • ConfigurationSettings class, ConfigurationElement class, ConfigurationElementCollection class, and ConfigurationElementProperty class
  • Implement IConfigurationSectionHandler interface
  • ConfigurationSection class, ConfigurationSectionCollection class, ConfigurationSectionGroup class, and ConfigurationSectionGroupCollection class
  • Implement ISettingsProviderService interface
  • Implement IApplicationSettingsProvider interface
  • ConfigurationValidationBase class
  • Implement IConfigurationSystem interface

This is the framework for reading/writing Configuration information. This has been overhauled in the 2.0 framework. Here's an article that gives an overview. Beware that it is referencing beta builds.

Paulo Reichert has a good blog entry on creating your own configuration file. Reading into the way the Microsoft has grouped these tasks together, I think that's what they want you to know.

Configuration class - A merged view of all configuration information. Meaning it merges all information from various web.config, machine.config and other config files to give you a look at all the config information for your current context.

ConfigurationManager - Static class that provides access to specific areas of config files - AppSettings, ConnectionStrings. Allows access to the standard config file, machine.config. Openning a config file returns a Configuration object.

ConfigurationSettings class - Doesn't look like it has changed much since 1.1.  Gets a readonly version of the config file.

ConfigurationElement - Represents an XML element in a config file.  Abstract class.  If you're writting your own config handler, you're probably going to start with a class based on ConfigurationElement.  See Paulo's blog entry mentioned above.

ConfigurationElementCollection - Collection of said ConfigurationElements.  Inherit from this when your config file has multiple elements of the same type.

ConfigurationElementProperty - Accessed as a property of the ConfigurationElement.  Allows you to set the validator.  There isn't much info on this object.

IConfigurationSectionHandler - "Handles the access to certain configuration sources".  This was the way that you did custom configuration sections in 1.1.  I don't think you should use it in 2.0 given the new objects we have to deal with Configuration files.  I could be wrong.

ConfigurationSection - Presents a configuration section in an XML file.  Abstract class.  Again, see Paulo's blog entry.

ConfigurationSectionCollection - "Represents a collection of related sections within a configuration file.Like ConnectionStrings.  You could have multiple instances of the ConnectionStrings in your config file.

ConfigurationSectionGroup - Container for groups of ConfigurationSections.  Think System.Web section in the web.config.  That is a ConfigurationSectionGroup (implemented in SystemWebSectionGroup)

ConfigurationSectionGroupCollection - Allows you to interate through a collection of ConfigurationSectionGroup objects.

ISettingsProvider - Interface that is used to divorce the physical reading/writing of configuration information from the logical need to read/write.  If you want to store config info in a place other than an XML file, you'll need to write a class that implements ISettingsProvider.  This doesn't appear to have changed from version 1.1

IApplicationSettingsProvider - "Defines extended capabilities for client-based application settings providers. ".  This is an another example of the provider architecture that is throughout the 2.0 framework.  This provider deals with getting config information for a specific version of the app, upgrading config info...  "The .NET Framework enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the Upgrade method, implemented in a class derived from SettingsProvider."

ConfigurationValidationBase - Base class for configuration file validations.  Specific implementations are objects such as StringValidator, IntegerValidator .  These can be applied as attributes to properties in your configuration object.  Paulo's blog entry has more information on these.

IConfigurationSystem - "This interface supports the .NET Framework and is not intended to be used directly in your code".  Which begs the question, why do I have to know about it for an exam?  This appears to be used to load up the config system, but I can't find any examples of its usage on the web.  It doesn't appear to be explicitly mentioned in any config file on my system (But I guess that would be a classic chicken or egg problem).  Reflector isn't pulling anything up that depends on it.  So I guess know that it exists?

The configuration section has substantially changed, so it would be to your benefit both for the exam and your own knowledge to take a fresh look at it.

I was going to look at debugging in this post, but I'll address that in the next post

Monday, January 30, 2006 3:43:44 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Comments are closed.
Copyright © 2008 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: