After setting this up with a few projects now I do feel that there is
some overhead with the
Configuration Application Block ie. having to setup a class to define the
configuration information (e.g. EditorFontData in the QuickStart) and then having to use the WriteConfiguration()
method to create your first instance of the config setting file mainly
because the XML is not something you can type out off the top of your
head! This can be a bit of a pain because you then have to write a
Manager class to use the configuration information class to populate
and pass it into the WriteConfiguration() and then run this passing in
the parameters you want.
I can see lots of advantages, e.g. your XML config files are strongly
typed and when you are calling them you are calling them as properties
so they will break at build time as apposed to at run-time like with
grabbing old app settings.
You can't really re-use these settings either for other projects
because each project will have different configuration settings. I did
notice you can create a 'Custom Transformer Provider' instead of a 'XML
Serializer Transformer' which you define a TypeName and also can set
Attributes.
I did try and add some attributes but really wasn't sure where these
Name Value pairs were being stored and can't find any information on
this. The helpful 'Help' button doesn't do anything either. With this
you use the standard Configuration.Transformer.XmlSerializerTransformer
type which extends ITransformer.
I'm assuming that the DataConfiguration Configuration Application Block uses this method.
It would be great to be able to just create a new Configuration
Application Block instance and add a few name value pairs and then be
able to get at these with the GetConfiguration() method without having
to define another class and call the WriteConfiguration() method. Maybe
I just want things too easy ;-)
Maybe if there was some more information somewhere on how to create a
configuration class that implemented ITransformer that could replace
the built-in XmlSerializerTransformer then you could then edit the
settings in the Enterprise Library Configurator directly which would be
even better.