From what I understand two components A and B should only communicate with one another via an interface. Ideally this interface should be in its own separate assembly so that the client need not be loaded with the dependencies of any particular interface implementation.
The question then is how do I pass information such as enums and custom Types that appear within the interface if the client is only dependent on the interface?
Eg:
public enum Status
{
Success,
Failure
}
public interface SomeInterface
{
Status CallAPI(string s);
}
In which assembly should Status
in this example reside so that both client and service can use the interface, but without breaking the principle of Dependency Inversion? Can it be contained within the same assembly as the stand-alone interface? What if the enum was replaced with a custom type that the interface depended on?