Ami*_*aei 10 oop design-patterns domain-driven-design
规范模式是DDD中使用的常见模式,它封装了业务逻辑以响应一个问题.
public interface ISpecification<T>
{
bool IsSatisfiedBy(T aSource);
}
public class CustomerHaveDiscountSpec : ISpecification<Customer>
{
bool IsSatisfiedBy(Customer aCustomer)
{
/* ... */
}
}
Run Code Online (Sandbox Code Playgroud)
域驱动设计中常见的其他模式是什么?
ora*_*ips 11
我快速推荐InfoQ的Domain Driven Design,它可以很好地提取Eric Evans的(太长)书.在@ Pangea的答案的基础上,对象列表值得一些描述:
我不认为我们将其称为模式,但一些概念是存储库,聚合根,值对象,实体,域服务,应用程序服务.以下两个链接很有帮助
http://dddcommunity.org/resources/ddd_terms
http://refcardz.dzone.com/refcardz/getting-started-domain-driven