ddd basics - context mapping
DESCRIPTION
A Context Map will visualize your system: cluttered models, too much or not enough communication, dependencies on other systems are just some of the insights you'll gain if your start using themTRANSCRIPT
![Page 1: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/1.jpg)
Stijn Volders
@ONE75
http://blog.one75.be
![Page 2: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/2.jpg)
Context MappingWhy a Context Map is essential for the success of your project
domaindriven.be – DDD Basics
![Page 3: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/3.jpg)
What
• A simple diagram with Bounded Context’s who are involved in your project an your relation with them
![Page 4: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/4.jpg)
Why
• Get insight in inter-team communication an their bandwith
• Measure to which extent a vision could be shared
• Help to decide if DDD is appropriate
![Page 5: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/5.jpg)
![Page 6: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/6.jpg)
It’s all about relations
![Page 7: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/7.jpg)
Relations fall into Patterns
• Partnership
• Customer/Supplier
• Big Ball of Mud
• Conformist
• Shared Kernel
• Separate Ways
![Page 8: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/8.jpg)
All relations have their price
![Page 9: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/9.jpg)
![Page 10: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/10.jpg)
Definition: Partnership
When teams in 2 contexts succeed or fail together
• Co-ordintad planning of development and joint management of integration
• Interdependent features should be scheduled so that they are completed for the same release
![Page 11: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/11.jpg)
Definition: Customer - Supplier
• 2 teams in an upstream/downstream relationship
• Upstream can succeed interdependently of the downstream team
• Downstream priorities factor into upstream planning
![Page 12: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/12.jpg)
Definition: Big Ball of Mud
When you have to deal with a big, monolithic (legacy) system
• Often with large intermixed models
![Page 13: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/13.jpg)
Definition: Conformist
• 2 teams in an upstream/downstream relationship
• Upstream has no motivation to provide for the downstream team’s needs
• Downstream team doesn’t put effort in translation
![Page 14: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/14.jpg)
Definition: Shared Kernel
Sharing a part of the model
• Very intimite interdependency
• Can leverage or undermine design work
• Must be kept small!
![Page 15: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/15.jpg)
Definition: Separate Ways
Used to cut loose systems
• Integration is always expensive
• When there is little to zero interest/benefit in integration
![Page 16: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/16.jpg)
Definition: Anticorruption Layer
• Isolating layer to limit impact of changes in an upstream system
• Requires little or no modification to the upstream system
• Translates in both directions between the 2 models
![Page 17: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/17.jpg)
Definition: Open Host Service
When you want to open your system for integration
• Protocol that gives access to your system as a set of services
• Open for everyone that needs to integrate with your system
• New services can be added on request but need to serve a “general” purpose
![Page 18: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/18.jpg)
Definition: Published Language
When you want a common language for translation between 2 bounded contexts
• Often combined with Open Host Service
![Page 19: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/19.jpg)
Upstream/Downstream
![Page 20: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/20.jpg)
Upstream/Downstream
• Not about the direction of the data!
• Upstream will influence downstream
• Might be technical (code)
• But also: schedule, responsiveness to external requests...
![Page 21: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/21.jpg)
Attention!
• Map the current situation, not the (desired) future
• If it’s a mess, show it. It’ll bring focus to the problems & risks involved in your project.
![Page 22: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/22.jpg)
Let’s try it!
![Page 23: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/23.jpg)
Domain: Amazon
![Page 24: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/24.jpg)
Step 1
• Draw each Context with the name (as known in the UL)
![Page 25: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/25.jpg)
Step 2
• Define which models communicate• Bandwith
![Page 26: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/26.jpg)
Step 3
• Indicate the direction of the relation, if applicable (Upstream/Downstream)
![Page 27: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/27.jpg)
Step 4
• Put the name of the Pattern on the relationship• Partnership
• Customer/Supplier
• Conformist
• Separate Ways
• Big Ball of Mud
• Shared Kernel
![Page 28: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/28.jpg)
Step 5
• Indicate which BC’s have explicit translation or sharing• Anti Corruption Layer
• Open Host/Published Language
![Page 29: DDD Basics - Context mapping](https://reader033.vdocument.in/reader033/viewer/2022051111/5561da21d8b42ab33f8b5c82/html5/thumbnails/29.jpg)
Questions?
Stijn Volders
@ONE75
http://blog.one75.be