views:

803

answers:

1

I'm looking for a way to create a data access layer that can either reside on a server and be accessed via WCF services or can reside on the local machine in which case it would just be accessed directly without having to run through iis. Is there a way to abstract this in such a way that changing from the local to the WCF version can be done via a configuration file?

+2  A: 

It sounds like you want the provider model.

Check out: http://dotnetslackers.com/articles/designpatterns/HowToWriteAProviderModel.aspx

You create two providers that share a common interface and choose the appropriate one based on the configuration.

Stever B