views:

82

answers:

1

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 EnvironmentConfiguration class based on the transient data (callingApplication) without having to pass the callingApplication variable to all the component methods that need configuration information?

A: 

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.

Mauricio Scheffer
Thanks for the link, there is a lot of useful information in there. However I definately want the behaviour to be affected by input parameters rather than using HTTP headers for example. IHandlerSelector looks interesting but how can I get access to the transient data to affect the selector behaviour?
Dan Ryan
From the article I linked above: "A multi-tenanted application should not look like a multi-tenanted application". If you start passing strings around like that, you will break this simple rule and things will become unnecessarily complicated. Therefore I strongly recommend against doing that.
Mauricio Scheffer
Thanks, I understand what you are saying but for this instance I really do need to pass the information in as input parameters (just trust me :)). I will add some more context to Kozmic's post above.
Dan Ryan

related questions