Search code examples
c#interfacedependenciesloose-coupling

Do you define an interface for every public class in your domain model? Pros and Cons?


Do you implement an interface for every public class in your domain model? Pros and Cons?

Update: If Repositories interfaces and domain model classes are defined in separate assemblies, wouldn't there be circular dependency if we do not define interfaces for every domain class.


Solution

  • No.

    Cons.

    1. Noise code.
    2. More to write.
    3. YAGNI.