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
"configurat ion reader" but I am not sure...
An example of the type of configuration I need to read:
<configuratio n>
<configSections >
<sectionGroup name="alpha">
<section name="serviceFa ctories" type="??, ??" />
</sectionGroup>
</configSections>
<alpha>
<serviceFactori es>
<serviceFacto ry name="wcfSearch ServiceFactory"
factorytype="Al pha.ServiceFact ory.WcfServiceF actory`1,
Alpha.Wcf.Servi ceFactory"
contract="alpha .poc.search.wcf .contract.ISear ch">
<property name="wcfDefini tion"
value="SearchSe rvice" />
</serviceFactory>
<serviceFacto ry name="localSear chServiceFactor y"
factorytype="Al pha.ServiceFact ory.SimpleLocal ServiceFactory` 1,
Alpha.Wcf.Servi ceFactory"
contract="alpha .poc.search.wcf .contract.ISear ch">
<property name="serviceTy pe"
value="alpha.po c.search.wcf.se rvice.Search,
alpha.poc.searc h.wcf.service" />
</serviceFactory>
</serviceFactorie s>
</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
"configurat ion reader" but I am not sure...
An example of the type of configuration I need to read:
<configuratio n>
<configSections >
<sectionGroup name="alpha">
<section name="serviceFa ctories" type="??, ??" />
</sectionGroup>
</configSections>
<alpha>
<serviceFactori es>
<serviceFacto ry name="wcfSearch ServiceFactory"
factorytype="Al pha.ServiceFact ory.WcfServiceF actory`1,
Alpha.Wcf.Servi ceFactory"
contract="alpha .poc.search.wcf .contract.ISear ch">
<property name="wcfDefini tion"
value="SearchSe rvice" />
</serviceFactory>
<serviceFacto ry name="localSear chServiceFactor y"
factorytype="Al pha.ServiceFact ory.SimpleLocal ServiceFactory` 1,
Alpha.Wcf.Servi ceFactory"
contract="alpha .poc.search.wcf .contract.ISear ch">
<property name="serviceTy pe"
value="alpha.po c.search.wcf.se rvice.Search,
alpha.poc.searc h.wcf.service" />
</serviceFactory>
</serviceFactorie s>
</alpha>
Thanks,
Peter
Comment