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...
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