你定义一个接口为您的域模型中的每个公共类?优点和缺点? [英] 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.
推荐答案
没有。
缺点。
- 杂色代码。
- 更写了。
- YAGNI。
这篇关于你定义一个接口为您的域模型中的每个公共类?优点和缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文