Skip to content

Commit 2eeb8bc

Browse files
authored
Doc updates for v5.15.0 (ContextMapper#45)
1 parent 0405885 commit 2eeb8bc

14 files changed

+141
-126
lines changed

_cmls/lang-ref-aggregate-4.cml

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BoundedContext PolicyManagementContext implements PolicyManagementDomain {
1212
}
1313
}
1414
Aggregate Products {
15-
useCases = CreateOfferForCustomer
15+
userStories = AddProductToOffer
1616

1717
Entity Product {
1818
aggregateRoot
@@ -25,7 +25,7 @@ BoundedContext PolicyManagementContext implements PolicyManagementDomain {
2525
}
2626
}
2727
Aggregate Contract {
28-
useCases = UpdateContract
28+
features = CreateOfferForCustomer, UpdateContract
2929

3030
Entity Contract {
3131
aggregateRoot
@@ -45,3 +45,7 @@ BoundedContext PolicyManagementContext implements PolicyManagementDomain {
4545
}
4646
}
4747
}
48+
49+
UseCase CreateOfferForCustomer
50+
UserStory UpdateContract
51+
UserStory AddProductToOffer

_cmls/lang-ref-aggregate-4.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
<span class="k">int</span> offerId
99
- <span class="k">Customer</span> client
10-
- <span class="k">List&lt;Product&gt;</span> products
10+
- <span class="k">List</span>&lt;Product&gt; products
1111
<span class="k">BigDecimal</span> price
1212
}
1313
}
1414
<span class="k">Aggregate</span> Products {
15-
<span class="k">useCases</span> = CreateOfferForCustomer
15+
<span class="k">userStories</span> = AddProductToOffer
1616

1717
<span class="k">Entity</span> Product {
1818
<span class="k">aggregateRoot</span>
@@ -25,14 +25,14 @@
2525
}
2626
}
2727
<span class="k">Aggregate</span> Contract {
28-
<span class="k">useCases</span> = UpdateContract
28+
<span class="k">features</span> = CreateOfferForCustomer, UpdateContract
2929

3030
<span class="k">Entity</span> Contract {
3131
<span class="k">aggregateRoot</span>
3232

3333
- <span class="k">ContractId</span> identifier
3434
- <span class="k">Customer</span> client
35-
- <span class="k">List&lt;Product&gt;</span> products
35+
- <span class="k">List</span>&lt;Product&gt; products
3636
}
3737
<span class="k">ValueObject</span> ContractId {
3838
<span class="k">int</span> contractId <span class="k">key</span>
@@ -45,4 +45,8 @@
4545
}
4646
}
4747
}
48+
49+
<span class="k">UseCase</span> CreateOfferForCustomer
50+
<span class="k">UserStory</span> UpdateContract
51+
<span class="k">UserStory</span> AddProductToOffer
4852
</pre></div>

_config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ plugins:
2727
- jekyll-redirect-from
2828
- jekyll-seo-tag
2929
- jekyll-sitemap
30-
- jekyll-redirect-from
3130

3231
exclude:
3332
- Gemfile

_data/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
docs:
3838
- architectural-refactorings
3939
- ar-split-aggregate-by-entities
40-
- ar-split-bounded-context-by-use-cases
40+
- ar-split-bounded-context-by-features
4141
- ar-split-bounded-context-by-owners
4242
- ar-extract-aggregates-by-volatility
4343
- ar-extract-aggregates-by-cohesion

_docs/architectural-refactorings/ar-merge-bounded-contexts.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ permalink: /docs/ar-merge-bounded-contexts/
66
Merges two bounded contexts together. The result is one bounded context containing all the aggregates of the two input bounded
77
contexts.
88

9+
<div class="alert alert-custom">
10+
<strong>Known limitation:</strong> Unfortunately, this AR does not work in <a href="/docs/vs-code/">VS Code</a> and <a href="/docs/online-ide/">online</a> in case the removed Bounded Context is referenced in a Context Map. This is due to <a href="https://github.com/eclipse/xtext-core/issues/1494">a bug in the Xtext framework</a>.
11+
</div>
12+
913
## Context & Rationales
1014
By decomposing a system into multiple bounded contexts we aim for loose coupling between the bounded context and a high cohesion
1115
within them. However, sometimes a decomposition may be too fine-granular and merging bounded contexts with a high
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "AR-2: Split Bounded Context by Features"
3+
permalink: /docs/ar-split-bounded-context-by-features/
4+
---
5+
6+
Splits a bounded context by grouping those aggregates together into one bounded context which are used by the same features: use case(s) and/or user stories.
7+
8+
**Hint:** An aggregate in CML can belong to multiple use cases and/or user stories (therefore the plural _Features_ in the AR name).
9+
10+
## Context & Rationales
11+
By decomposing a system into multiple bounded contexts we aim for loose coupling between the bounded context and a high cohesion
12+
within them. One approach to achieve this and to decompose a system into components or (micro-) services is to split by use cases and/or user stories.
13+
14+
**See also:**
15+
* Coupling criterion [Semantic Proximity](https://github.com/ServiceCutter/ServiceCutter/wiki/CC-2-Semantic-Proximity) of [ServiceCutter](https://servicecutter.github.io/)
16+
* [How to decompose the application into services?](https://microservices.io/patterns/microservices.html#how-to-decompose-the-application-into-services) by [Chris Richardson](https://microservices.io/book)
17+
* [Single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle)
18+
19+
In Context Mapper you can assign multiple use cases and/or user stories to an aggregate, which allows you to model by which features an aggregate
20+
is used. Consult our [aggregate documentation page](https://contextmapper.github.io/docs/aggregate/#aggregate-use-cases) to see
21+
how this can be modeled in CML. The [user requirements](/docs/user-requirements/) page documents how you specify your user stories and/or use cases.
22+
23+
## Goal
24+
This Architectural Refactoring (AR) splits a bounded context by features (or _user requirements_). This means, it creates bounded contexts containing aggregates which are used by the same use cases and/or user stories. It can be applied if your model exhibits a bounded contexts with aggregates which are used by different cases/stories.
25+
26+
**Inverse AR's:**
27+
* [AR-7: Merge Bounded Contexts](/docs/ar-merge-bounded-contexts/)
28+
29+
## Preconditions
30+
* The bounded context must contain **at least two aggregates**.
31+
* The aggregates must be **assigned to different use cases and/or user stories**.
32+
33+
## Input
34+
* One bounded context.
35+
36+
## Output
37+
* The AR creates multiple bounded contexts. Each bounded context contains one or more aggregates which are used by the same
38+
use cases and/or user stories.
39+
40+
## Example
41+
The following example illustrates how this AR can be applied. The corresponding sources can be found in our
42+
[examples repository](https://github.com/ContextMapper/context-mapper-examples/tree/master/src/main/cml/architectural-refactorings).
43+
44+
### Input
45+
The example bounded context contains two aggregates which are used by different use cases. The AR is available on the bounded context:
46+
47+
<a href="/img/split-bc-by-use-cases-input.png">![Split Bounded Context by Use Cases Example Input](/img/split-bc-by-use-cases-input.png)</a>
48+
49+
### Result
50+
The resulting model contains two bounded contexts, one for each use case:
51+
52+
<a href="/img/split-bc-by-use-cases-output.png">![Split Bounded Context by Use Cases Example Output](/img/split-bc-by-use-cases-output.png)</a>
53+
54+
## Example Sources
55+
* You can find the CML sources for this AR example
56+
[here](https://github.com/ContextMapper/context-mapper-examples/tree/master/src/main/cml/architectural-refactorings/AR-02-Split-Bounded-Context-by-Use-Cases).
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,5 @@
11
---
2-
title: "AR-2: Split Bounded Context by Use Cases"
2+
title: "AR-2: Split Bounded Context by Features"
33
permalink: /docs/ar-split-bounded-context-by-use-cases/
4+
redirect_to: /docs/ar-split-bounded-context-by-features/
45
---
5-
6-
Splits a bounded context by grouping those aggregates together into one bounded context which are used by the same use case(s).
7-
8-
**Hint:** An aggregate in CML can belong to multiple use cases (therefore the plural _use cases_ in the AR name).
9-
10-
## Context & Rationales
11-
By decomposing a system into multiple bounded contexts we aim for loose coupling between the bounded context and a high cohesion
12-
within them. One approach to achieve this and to decompose a system into components or (micro-) services is to split by use cases.
13-
14-
**See also:**
15-
* Coupling criterion [Semantic Proximity](https://github.com/ServiceCutter/ServiceCutter/wiki/CC-2-Semantic-Proximity) of [ServiceCutter](https://servicecutter.github.io/)
16-
* [How to decompose the application into services?](https://microservices.io/patterns/microservices.html#how-to-decompose-the-application-into-services) by [Chris Richardson](https://microservices.io/book)
17-
* [Single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle)
18-
19-
In Context Mapper you can assign multiple use cases to an aggregate, which allows you to model by which use cases an aggregate
20-
is used. Consult our [aggregate documentation page](https://contextmapper.github.io/docs/aggregate/#aggregate-use-cases) to see
21-
how this can be modeled in CML.
22-
23-
## Goal
24-
This Architectural Refactoring (AR) splits a bounded context by use cases. This means, it creates bounded contexts containing
25-
aggregates which are used by the same use cases. It can be applied if your model exhibits a bounded contexts with aggregates which
26-
are used by multiple different use cases.
27-
28-
**Inverse AR's:**
29-
* [AR-7: Merge Bounded Contexts](/docs/ar-merge-bounded-contexts/)
30-
31-
## Preconditions
32-
* The bounded context must contain **at least two aggregates**.
33-
* The aggregates must be **assigned to different use cases**.
34-
35-
## Input
36-
* One bounded context.
37-
38-
## Output
39-
* The AR creates multiple bounded contexts. Each bounded context contains one or more aggregates which are used by the same
40-
use cases.
41-
42-
## Example
43-
The following example illustrates how this AR can be applied. The corresponding sources can be found in our
44-
[examples repository](https://github.com/ContextMapper/context-mapper-examples/tree/master/src/main/cml/architectural-refactorings).
45-
46-
### Input
47-
The example bounded context contains two aggregates which are used by different use cases. The AR is available on the bounded context:
48-
49-
<a href="/img/split-bc-by-use-cases-input.png">![Split Bounded Context by Use Cases Example Input](/img/split-bc-by-use-cases-input.png)</a>
50-
51-
### Result
52-
The resulting model contains two bounded contexts, one for each use case:
53-
54-
<a href="/img/split-bc-by-use-cases-output.png">![Split Bounded Context by Use Cases Example Output](/img/split-bc-by-use-cases-output.png)</a>
55-
56-
## Example Sources
57-
* You can find the CML sources for this AR example
58-
[here](https://github.com/ContextMapper/context-mapper-examples/tree/master/src/main/cml/architectural-refactorings/AR-02-Split-Bounded-Context-by-Use-Cases).

_docs/architectural-refactorings/ar-suspend-partnership.md

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ relationship and replace it with another strategy how the two Bounded Contexts d
1919

2020
Since the two teams have to work very closely together, a solution might be to merge the teams and see them as one single Bounded Context.
2121
This strategy basically calls the [AR-7 Merge Bounded Contexts](./../AR-7-Merge-Bounded-Contexts) refactoring to merge the two contexts.
22+
23+
<div class="alert alert-custom">
24+
<strong>Known limitation:</strong> Unfortunately, this strategy does not work in <a href="/docs/vs-code/">VS Code</a> and <a href="/docs/online-ide/">online</a> in case the removed Bounded Context is referenced in a Context Map. This is due to <a href="https://github.com/eclipse/xtext-core/issues/1494">a bug in the Xtext framework</a>.
25+
</div>
26+
2227

2328
* **b) Extract a new Bounded Context for commonalities and establish upstream-downstream relationships:**
2429

_docs/architectural-refactorings/architectural-refactorings.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ image: /img/cm-og-image.png
66

77
This section provides a documentation of all [architectural refactorings (ARs)](https://www.infoq.com/articles/architectural-refactoring/) available in the Context Mapper tool.
88

9-
<div class="alert alert-custom">
10-
<strong>Note:</strong> Architectural Refactorings (AR) are not yet supported in our new Visual Studio Code extension. We continuously work on the extension and will support them soon! To apply the ARs to your CML model you have to use the Eclipse plugin for now. You can find a feature support table for Eclipse and VS Code <a href="/docs/ide/">here</a>.<br/><br/>The AR "Split Bounded Context by Owner" is already supported now (as an example to illustrate how they will be integrated to VS Code).
11-
</div>
12-
139
## Motivation: Why Refactoring?
1410
The provided refactorings ensure that the result is always a correct CML model which compiles without errors.
1511
If you perform similar changes manually, you also have to fix errors that occur manually within the [Context Map](/docs/context-map/).
@@ -31,7 +27,7 @@ We currently provide the following structural ARs:
3127
| Name | Subject | Description | Input | Output |
3228
|---------------------------------------------------------------------------------------------------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|-------------------------------------------------------------------|
3329
| [**AR-1: Split Aggregate by Entities**](/docs/ar-split-aggregate-by-entities) | Aggregate | Splits an aggregate which contains multiple entities and produces one aggregate per entity. | 1 Aggregate | n Aggregates |
34-
| [**AR-2: Split Bounded Context by Use Cases**<sup>1</sup>](/docs/ar-split-bounded-context-by-use-cases) | Bounded Context | Splits a bounded context by grouping those aggregates together into one bounded context which are used by the same use case(s). | 1 Bounded Context | n Bounded Contexts |
30+
| [**AR-2: Split Bounded Context by Features**<sup>1</sup>](/docs/ar-split-bounded-context-by-features) | Bounded Context | Splits a bounded context by grouping those aggregates together into one bounded context which are used by the same use case(s) and/or user stories (features). | 1 Bounded Context | n Bounded Contexts |
3531
| [**AR-3: Split Bounded Context by Owner**<sup>1</sup>](/docs/ar-split-bounded-context-by-owners) | Bounded Context | Splits a bounded context by grouping those aggregates together into one bounded context which belong to the same team. | 1 Bounded Context | n Bounded Contexts |
3632
| [**AR-4: Extract Aggregates by Volatility**](/docs/ar-extract-aggregates-by-volatility) | Bounded Context | Extracts all aggregates from a bounded context by a given volatility, or likelihood for change (RARELY, NORMAL or OFTEN), and moves them to a separate context. | 1 Bounded Context | 2 Bounded Contexts |
3733
| [**AR-5: Extract Aggregates by Cohesion**](/docs/ar-extract-aggregates-by-cohesion) | Bounded Context | Extracts a set of aggregates which are chosen by certain cohesion criteria and moves them to a separate bounded context. | 1 Bounded Context | 2 Bounded Contexts |
@@ -40,7 +36,7 @@ We currently provide the following structural ARs:
4036
| [**AR-8: Extract Shared Kernel**](/docs/ar-extract-shared-kernel) | Shared Kernel relationship | Extracts a new bounded context for the common model parts of the Shared Kernel and establishes two upstream-downstream relationship between the new and the existing Bounded Contexts. | 1 Shared Kernel relationship | 1 New Bounded Context and 2 new upstream-downstream relationships |
4137
| [**AR-9: Suspend Partnership**](/docs/ar-suspend-partnership) | Partnership relationship | Suspends a Partnership relationship and replaces it with another structure how the two Bounded Context can depend on each other. The AR provides three strategies to suspend the partnership. | 1 Partnership relationship | _Depends on the selected mode_ |
4238

43-
<sup>1</sup>: An aggregate in CML can be used by **multiple** use cases and is owned by **one** owner (team).
39+
<sup>1</sup>: An aggregate in CML can be used by **multiple** features (use cases and/or user stories) and is owned by **one** owner (team).
4440

4541
### Relationship Refactorings
4642
The following ARs to change Context Map relationships are currently implemented:

0 commit comments

Comments
 (0)