I have a requirement to add a layer between the external library and the client code, so that the client has a consistent interface with the base library, and we can disable the library with minimal code changes.
For instance:
public interface IConsistentInterface { void Foo(string bar); void Bar(string foo); }
An internally specific implementation of this interface will be called in the library using any functionality that offers. Thus, if we disable the library, we just need to change the internal calls of specific types of this interface.
It looks like an adapter template, but is there a better approach to this problem?
Thanks.
source share