Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
To test this, we decided to setup an interface and two derived classes. Then we added corresponding data to the database (we will build an intuitive graphical user interface eventually). Finally, we used the Container Singleton class to resolve our types and print out the results.
Class Diagram:
Database:
Windsor Component View
Lookup Name
Namespace
Contract
Implementation
Component Id
Contract Id
Test1
DBinsor.Svc.WCF.Client
IMath
Add
1844d2e0-455e-4d44-a9ff-1c63f78e407b
0aa71152-91d4-4e8f-a4a0-4124a98e2851
Subtract
5c3ee79a-926c-4438-8391-44a437bd8f47
Windsor Parameters View
Parm Name
Default
Override
a
1
13
b
2
NULL
Classes:
Test:
IMath proxy = ContainerSingleton.Instance.Resolve<Add, IMath>();
Console.WriteLine(proxy.Calculate().ToString());
proxy = ContainerSingleton.Instance.Resolve<Subtract, IMath>();
Console.WriteLine(ContainerSingleton.Instance.Xml);
Result:
3
11
<configuration>
<components>
<component id="DBinsor.Svc.WCF.Client.Add"
service="DBinsor.Svc.WCF.Client.IMath, DBinsor.Svc.WCF.Client" type="DBinsor.Svc.WCF.Client.Add, DBinsor.Svc.WCF.Client">
<parameters>
<a>1</a>
<b>2</b>
</parameters>
</component>
<component id="DBinsor.Svc.WCF.Client.Subtract"
service="DBinsor.Svc.WCF.Client.IMath, DBinsor.Svc.WCF.Client" type="DBinsor.Svc.WCF.Client.Subtract, DBinsor.Svc.WCF.Client">
<a>13</a>
</components>
</configuration>