Skip to content

Context Map

The context map visualizes the bounded context relationships defined in domains.json. Each node represents a bounded context. Edges show upstream/downstream relationships with their integration type (conformist, ACL, partnership, shared-kernel).

The visualization renders data from a domains.json file using ERPNext as the reference dataset:

  • Node size reflects lines of code in the context
  • Node color indicates context type: core (blue), supporting (green), generic (gray)
  • Edge labels show the relationship type between contexts
  • Edge direction flows from upstream to downstream

This visualization renders the following domains.json structure:

{
"contexts": [
{ "name": "Accounts", "type": "core", "loc": 45000, "dependencies": ["Stock", "Selling", "Buying"] },
{ "name": "Stock", "type": "supporting", "loc": 28000, "dependencies": ["Accounts"] },
{ "name": "Selling", "type": "supporting", "loc": 12000, "dependencies": ["Accounts", "Stock"] },
{ "name": "Buying", "type": "supporting", "loc": 10000, "dependencies": ["Accounts", "Stock"] },
{ "name": "Setup", "type": "generic", "loc": 8000, "dependencies": [] }
],
"contextMap": [
{ "upstream": "Accounts", "downstream": "Stock", "type": "conformist" },
{ "upstream": "Accounts", "downstream": "Selling", "type": "conformist" },
{ "upstream": "Accounts", "downstream": "Buying", "type": "conformist" },
{ "upstream": "Setup", "downstream": "Accounts", "type": "shared-kernel" }
]
}
RelationshipMeaningVisual
ConformistDownstream adopts upstream’s model without translationSolid arrow
ACLAnti-Corruption Layer translates between modelsDashed arrow with shield
PartnershipBoth contexts evolve togetherBidirectional arrow
Shared KernelShared code/model owned jointlyThick connecting line

Context maps answer critical questions during extraction:

  1. Where to start? — Core contexts with few upstream dependencies
  2. What breaks if I change this? — Follow downstream relationships
  3. Where do I need ACLs? — At conformist boundaries that should become independent
  4. What can be extracted independently? — Generic contexts with low coupling