开发者

How do I Resolve dependancies that rely on transient context data using castle windsor?

I have a WCF service application that uses a component called EnvironmentConfiguration that holds configuration information for my application. I am converting this service so that it can be used by different applications that have different configuration requirements.

I want to identify the configuration to use by allowing an additional parameter to be passed to the service call i.e.

public void DoSomething(string originalParameter, string callingApplication)

What is the recommended way to alter the behaviour of the EnvironmentConfigur开发者_StackOverflowation class based on the transient data (callingApplication) without having to pass the callingApplication variable to all the component methods that need configuration information?


It seems you want to make your service multi-tenant. Take a look at this article about Windsor and multi-tenancy. Passing a "callingApplication" parameter is not the best way to do this. Identify your calling application using something like a SSL certificate, a custom HTTP header (assuming you're using some HTTP endpoints), etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜