Discussion about this post

User's avatar
reader's avatar

What if I use an interface to reduce dependencies between layers? For example, I always create an IUserRepository interface in the domain layer and then implement it with a UserRepository. In that case, Iโ€™m reducing the dependency of the infrastructure on the domain, which aligns with Clean Architecture, right?

Expand full comment
Neural Foundry's avatar

The one-to-one relationship point really resonates. Ive defintely been guilty of creating interfaces for that just in case scenario, and youre right, that second implementtion almost never comes. The delegation pattern for testing is interesting, I hadnt considered that as an alterntive. Do you find that teams with less experienc tend to over-engineer with interfaces more often?

Expand full comment
4 more comments...

No posts

Ready for more?