DDD存储库

Mor*_*rph 3 c# domain-driven-design repository-pattern

在创建存储库类时,例如.CustomerRepository,我的方法应该是静态的吗?

或者我应该首先实例化CustomerRepository类,然后调用实例上的公共方法?

哪种方法最好,为什么?

谢谢

Fin*_*las 12

我会选择一个instance简单的单元测试 - 例如,模拟很难用static方法.

Static方法是可测试性的死亡.