Reading complex configuration

  • Thread starter Thread starter Peter K
  • Start date Start date
P

Peter K

Hi

I need to be able to supply some relatively complex configuration to an
application. The application will either run in a web context (with a
web.config file, or as a application with an app.config).

The only configuration reading I have used before is AppSettings["name"]
and I have also used Spring Framework. It is more the type of
configuration that Spring uses I am looking at now.

Basically I am looking for some pointers on where to start learning how
to do this - and/or some example code. I think I have to implement a
"configuration reader" but I am not sure...


An example of the type of configuration I need to read:


<configuration>

<configSections>
<sectionGroup name="alpha">
<section name="serviceFactories" type="??, ??" />
</sectionGroup>
</configSections>

<alpha>
<serviceFactories>

<serviceFactory name="wcfSearchServiceFactory"
factorytype="Alpha.ServiceFactory.WcfServiceFactory`1,
Alpha.Wcf.ServiceFactory"
contract="alpha.poc.search.wcf.contract.ISearch">
<property name="wcfDefinition"
value="SearchService" />
</serviceFactory>

<serviceFactory name="localSearchServiceFactory"
factorytype="Alpha.ServiceFactory.SimpleLocalServiceFactory`1,
Alpha.Wcf.ServiceFactory"
contract="alpha.poc.search.wcf.contract.ISearch">
<property name="serviceType"
value="alpha.poc.search.wcf.service.Search,
alpha.poc.search.wcf.service" />
</serviceFactory>

</serviceFactories>
</alpha>





Thanks,
Peter
 
I need to be able to supply some relatively complex configuration to an
application. The application will either run in a web context (with a
web.config file, or as a application with an app.config).

The only configuration reading I have used before is AppSettings["name"]
and I have also used Spring Framework. It is more the type of
configuration that Spring uses I am looking at now.

Basically I am looking for some pointers on where to start learning how
to do this - and/or some example code. I think I have to implement a
"configuration reader" but I am not sure...

Why implement a configuration reader when Spring has done it all for
you? Can you not
use Spring for some reason?

Jon
 
I need to be able to supply some relatively complex configuration to an
application. The application will either run in a web context (with a
web.config file, or as a application with an app.config).

The only configuration reading I have used before is AppSettings["name"]
and I have also used Spring Framework. It is more the type of
configuration that Spring uses I am looking at now.

Basically I am looking for some pointers on where to start learning how
to do this - and/or some example code. I think I have to implement a
"configuration reader" but I am not sure...

Why implement a configuration reader when Spring has done it all for
you? Can you not
use Spring for some reason?

Unfortunately no !!!

The customer I am working for at the moment does not like open source.
Don't ask.

I have used Spring (both java and .net) very successfully over the course
of several years, and not stumbled across any significant problems. To tell
the truth I trust Spring's configuration management (and dependency
injection) a helluva lot more than my "roll your own" version, but there
you go...

But I have found some information regarding ConfigurationSection, and I
think that is the way to go.
http://msdn2.microsoft.com/en-us/library/2tw134k3.aspx

/Peter
 
Unfortunately no !!!

The customer I am working for at the moment does not like open source.
Don't ask.

Blech. The world is completely mad. :(
I have used Spring (both java and .net) very successfully over the course
of several years, and not stumbled across any significant problems. To tell
the truth I trust Spring's configuration management (and dependency
injection) a helluva lot more than my "roll your own" version, but there
you go...
:)

But I have found some information regarding ConfigurationSection, and I
think that is the way to go.http://msdn2.microsoft.com/en-us/library/2tw134k3.aspx

It's certainly *a* way to go, yes :)

Jon
 
Back
Top