Mon, Jan 30 2006 10:00 PM
Olaf Conijn
EnterpriseLibraryExtensions, first drop
As promised in an earlier post I am putting together some ‘extensions’ to go with the January 2006 release of Enterprise Library (or Enterprise Library for .NET 2.0).
Since the extensions share common code, I started out with 2 relative simple nodes: “Configuration Constants Writer” and “Configuration Protector”. These implementations seem trivial but introduce new designtime concepts like “ExtenderProviders” and “DesignerVerbs”, which I’ll need for the other (more complex) extensions.
The implementation of the first 2 extensions are pretty stable (though unlike the p&p dev-team, I don’t have a test-team) and reckoned this might be a good time to put them on the online (and - who knows? - get some feedback).
Configuration Constants Writer
This extension provides compiletime safety when referencing EntLib providers from your code. It maintains a code file with constants that contain the names of the providers you would like to use. If you include this file in your project, you don’t have to worry about changing the names of the providers you used.
Make sure you reference providers by their constant, the constant's value will change after changing the provider’s name.
|
The Configuration Constants Writer node and its settings.

A 'Constant name' on a connectionstring node and the code file that is generated.
Configuration Protector
The Configuration Protector can be used to encrypt your configuration file to protect sensitive information such as connectionstrings. It uses the .net v2 frameworks Protected Configuration API, which is well documented on MSDN.

The Configuration Protector node and its settings.

Example of a protected Data Access Application block's configuration.
Password (connectionstring) Parameter
Since we can protect our configuration, it would be a shame to have to edit the connectionstring’s password property in plain text. Therefore I added a “Password Parameter” to the configuration console. The Password Parameter provides a nice UI to edit your databases connectionstring.

Fancy UI to edit a connectionstring's password property.
Installation and download
EDIT: Please visit the Enterprise Library Extensions page for the latest download and installation notes.