Skip to content

Commit d2ba1e4

Browse files
committed
Update README for team maps
1 parent 071213f commit d2ba1e4

File tree

6 files changed

+65
-4
lines changed

6 files changed

+65
-4
lines changed

README.md

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ new ContextMapGenerator().setLabelSpacingFactor(10)
7878

7979
The program above generates the following Context Map:
8080

81-
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-1.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-1.png" alt="Example Context Map" /></a>
81+
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-1.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-1.png" alt="Example Context Map" /></a>
8282

8383
### Labels
8484
Optionally it is possible to define a `name` or `implementation technology` for each relationship by using the corresponding setters. The following example calls show how we set them on relationships from the example above:
@@ -95,7 +95,67 @@ Optionally it is possible to define a `name` or `implementation technology` for
9595

9696
The generator adds those information as additional labels to the generated relationships, as this example shows:
9797

98-
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-3.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-3.png" alt="Example Context Map" /></a>
98+
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-3.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-3.png" alt="Example Context Map" /></a>
99+
100+
### Team Maps
101+
The Context Map generator also allows users to illustrate which development teams work on which subsystems, components, or Bounded Contexts. By default, a Bounded Context is of
102+
the type "generic", but there is another constructor that allows you to create Bounded Contexts of the type "team". If a Bounded Context is of the type "team", it can
103+
"realize" a Bounded Context of the type "generic". The following example illustrates how you can use this concept to visualize which teams work on which Bounded Contexts:
104+
105+
```java
106+
BoundedContext customerManagement = new BoundedContext("Customer Management Context");
107+
BoundedContext customerSelfService = new BoundedContext("Customer Self-Service Context");
108+
BoundedContext policyManagementContext = new BoundedContext("Policy Management Context");
109+
BoundedContext riskManagementContext = new BoundedContext("Risk Management Context");
110+
111+
BoundedContext customersBackendTeam = new BoundedContext("Customers Backend Team", BoundedContextType.TEAM)
112+
.realizing(customerManagement);
113+
BoundedContext customersFrontendTeam = new BoundedContext("Customers Frontend Team", BoundedContextType.TEAM)
114+
.realizing(customerSelfService);
115+
BoundedContext contractsTeam = new BoundedContext("Contracts", BoundedContextType.TEAM)
116+
.realizing(policyManagementContext);
117+
BoundedContext claimsTeam = new BoundedContext("Claims", BoundedContextType.TEAM)
118+
.realizing(riskManagementContext);
119+
120+
ContextMap contextMap = new ContextMap()
121+
.addBoundedContext(customerManagement)
122+
.addBoundedContext(customerSelfService)
123+
.addBoundedContext(policyManagementContext)
124+
.addBoundedContext(riskManagementContext)
125+
.addBoundedContext(customersBackendTeam)
126+
.addBoundedContext(customersFrontendTeam)
127+
.addBoundedContext(contractsTeam)
128+
.addBoundedContext(claimsTeam)
129+
.addRelationship(new UpstreamDownstreamRelationship(customerManagement, customerSelfService)
130+
.setCustomerSupplier(true))
131+
.addRelationship(new UpstreamDownstreamRelationship(customerManagement, policyManagementContext)
132+
.setUpstreamPatterns(OPEN_HOST_SERVICE, PUBLISHED_LANGUAGE)
133+
.setDownstreamPatterns(CONFORMIST))
134+
.addRelationship(new Partnership(policyManagementContext, riskManagementContext))
135+
.addRelationship(new UpstreamDownstreamRelationship(customersBackendTeam, customersFrontendTeam)
136+
.setCustomerSupplier(true))
137+
.addRelationship(new UpstreamDownstreamRelationship(customersBackendTeam, contractsTeam))
138+
.addRelationship(new Partnership(contractsTeam, claimsTeam));
139+
140+
new ContextMapGenerator()
141+
.generateContextMapGraphic(contextMap, Format.PNG, "/home/user/myContextMap.png");
142+
```
143+
144+
By default, the generator produces the following _team map_:
145+
146+
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/team-map-example-1.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/team-map-example-1.png" alt="Example Team Map (Clustered)" /></a>
147+
148+
As you can see, the generator clusters the Bounded Contexts of the two types (teams and generic BCs) together. Alternatively, you can disable the clustering as follows:
149+
150+
```java
151+
new ContextMapGenerator()
152+
.clusterTeams(false) // disable clustering
153+
.generateContextMapGraphic(contextMap, Format.PNG, "/home/user/myContextMap.png");
154+
```
155+
156+
In this case the produced graphic looks as follows:
157+
158+
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/team-map-example-2.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/team-map-example-2.png" alt="Example Team Map (Unclustered)" /></a>
99159

100160
### DDD "Cargo" Sample Application
101161
```java
@@ -121,7 +181,7 @@ new ContextMapGenerator().setLabelSpacingFactor(10)
121181

122182
The result:
123183

124-
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-2.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/context-map-example-2.png" alt="Example Context Map" /></a>
184+
<a href="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-2.png" target="_blank"><img src="https://raw.githubusercontent.com/ContextMapper/context-map-generator/master/examples/context-map-example-2.png" alt="Example Context Map" /></a>
125185

126186
## Parameters
127187
With the following methods you can parameterize the `ContextMapGenerator`:
@@ -131,13 +191,14 @@ With the following methods you can parameterize the `ContextMapGenerator`:
131191
| setHeight(int height) | By using this parameter you can fix the height of the produced image. Note that if you use fix the height, the width will be adjusted dynamically. | 1000 |
132192
| setWidth(int width) | By using this parameter you can fix the width of the produced image. Note that if you use fix the width, the height will be adjusted dynamically. | 2000 |
133193
| setLabelSpacingFactor(int spacingFactor) | The Graphviz layouting algorithm doesn't ensure that the labels of the edges do not overlap. Especially the boxes with the relationship patterns (OHS, PL, ACL, CF) may often overlap in our case. By introducing spacing between the edges we can often bypass this issue. This parameter (a factor between 1 and 20) controls how much spacing we add. | 1 |
194+
| clusterTeams(boolean clusterTeams) | This parameter allows you to control whether Bounded Contexts of the different types (teams vs. generic) are clustered together or not. It is relevant for team maps only (see example team maps above). | true |
134195

135196
## Supported Output Formats
136197
As illustrated in the example code above, the `generateContextMapGraphic` method takes a parameter to define the output format. The following formats are supported:
137198

138199
* PNG
139200
* SVG
140-
* DOT ([Graphviz dot format](https://www.graphviz.org/doc/info/lang.html))
201+
* DOT ([Graphviz dot format](https://www.graphviz.org/doc/info/lang.html); *.gv file)
141202

142203
## Development / Build
143204
If you want to contribute to this project you can create a fork and a pull request. The project is built with Gradle, so you can import it as Gradle project within Eclipse or IntelliJ IDEA (or any other IDE supporting Gradle).
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/team-map-example-1.png

159 KB
Loading

examples/team-map-example-2.png

173 KB
Loading

0 commit comments

Comments
 (0)