What are common DDD (Domain-Driven Design) templates?

A specification template is a generic template used in DDD that encapsulates business logic to answer one question.

public interface ISpecification<T> { bool IsSatisfiedBy(T aSource); } public class CustomerHaveDiscountSpec : ISpecification<Customer> { bool IsSatisfiedBy(Customer aCustomer) { /* ... */ } } 

What other templates are common for domain-driven design?

+6
oop design-patterns domain-driven-design
source share
2 answers

I recommend the InfoQ Domain Driven Design quickly , which does a good job of redoing Eric Evans' (too) longer book. Based on @Pangea's answer, the list of objects deserves some description:

  • Repository : encapsulates persistence and search - usually a database
  • Service : A non-persistent API server object used for aggregate root CRUD
  • Aggregate Root : An object whose other child composite objects do not make sense without it is perhaps the most important aspect from the perspective of the API when talking about DDD
  • Value object: an object whose state does not change after the instance is created (for example, color) is especially useful in multi-threaded programming, since using such concurrency exceptions causes problems
+4
source share

I don’t think we call it templates, but some concepts are repository, aggregate root, value object, entity, domain services, applications. The following two links are useful

http://dddcommunity.org/resources/ddd_terms

http://refcardz.dzone.com/refcardz/getting-started-domain-driven

+3
source share

All Articles