Sometimes, configuration values need to be 'calculated' based on other configuration values, or be retrieved from the current environment, constants etc. The current implementation assumes that every configuration value comes from a dedicated, decoupled IConfigStore. A way to introduce this feature would be utilizing Castles CreateInterfaceProxyWithTarget method on the ProxyGenerator. The implementation would be sth. like this:
A method AddDefaults would allow the developer to specify a type which implements the T contract.
Specifying a 'default' implementation would use CreateInterfaceProxyWithTarget instead of CreateInterfaceProxyWithoutTarget on the ProxyGenerator.
When retrieving configuration values, the library should check whether there's a default implementation.
If there's a default implementation, no IConfigSource provides a certain configuration value and the default implementation only has a getter, the value would be retrieved from the default implementation.
Sometimes, configuration values need to be 'calculated' based on other configuration values, or be retrieved from the current environment, constants etc. The current implementation assumes that every configuration value comes from a dedicated, decoupled
IConfigStore
. A way to introduce this feature would be utilizing CastlesCreateInterfaceProxyWithTarget
method on theProxyGenerator
. The implementation would be sth. like this:AddDefaults
would allow the developer to specify a type which implements theT
contract.CreateInterfaceProxyWithTarget
instead ofCreateInterfaceProxyWithoutTarget
on theProxyGenerator
.IConfigSource
provides a certain configuration value and the default implementation only has a getter, the value would be retrieved from the default implementation.