3
我读过blog about DDD from Matt PettersDDD库和工厂
,并根据它就在那里说,我们为每个实体存储库(接口),之后我们创建了要给实例一RepositoryFactory(声明作为接口)存储库
这是如何使用DDD完成项目的?
我的意思是,我看到了,我认为他们使用DDD的项目,但他们被直接调用每一个仓库,没有工厂参与
也
为什么我们需要创建这么多的资源库类,为什么不使用像
public interface IRepository : IDisposable
{
T[] GetAll();
T[] GetAll(Expression<Func> filter);
T GetSingle(Expression<Func> filter);
T GetSingle(Expression<Func> filter, List<Expression<Func>> subSelectors);
void Delete(T entity);
void Add(T entity);
int SaveChanges();
}
我想这可能是违反了固体原则,或其他什么东西?