Introduction au principaux concepts de DDD avec un lien Github pour mettre en place ces derniers.
Par Gérome Egron et Nicolas Jozwiak, consultants chez Xebia
7. DOMAIN
• Core business of the company!
!
• Represents a sphere of knowledge!
!
• Create best software by concentrating on the
problems related to the domain!
8. DOMAIN
• Not focus on technologies!
!
• Ubiquitous language !
! structured language around the domain
model and used by all team members
9. MODEL DRIVEN DESIGN
• Represents the domain model in terms of software!
!
• Code modification means changing model!
!
• Model is adapted to a usage, a context
11. ENTITIES
• entity = identity + state!
!
• long lifecycle!
• has to have an operational way of applying identity!
• Identity has to be guaranted unique within the system
12. ENTITIES
• The object state is the sum of its data values which
define it at a precise moment in time!
!
• Different stable state which occurs with transformations!
!
• Mutable and immutable attributes!
13. VALUE OBJECTS
• No conceptual identity!
!
• Immutable!
!
• Focus of their domain!
!
• Reflect constraints!
14. VALUE OBJECTS
• Help to define the state of other entities objects!
!
• Construction has to be meaningful and well formed
15. VALUE OBJECTS
• Make implicit concepts explicit
void addCustomer(String, String)
void addCustomer(Name, PhoneNumber)
16. AGGREGATES
• Treats domain objects as a single unit!
!
• Operations have to interfer with root!
!
• Ensure integrity of the whole!
17. SERVICES
• When a significant process or transformation in the
domain is not a responsibility of an entity or value object!
!
• Define an interface in terms of language of the model!
!
• Have to be stateless!
18. SERVICE TYPES
• Domain service!
!
• Infrastructure service!
!
• Application service
20. BOUNDED CONTEXT
• Model has a limit!
!
• Communication with others domains!
!
• anticorruption layer!
• conformist!
• shared kernel!
• customer/supplier relationship!
• separate ways!
• open host