Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOAD page #37

Merged
merged 10 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions _cmls/lang-ref-use-case-1.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
UseCase UC1_Example {
actor = "Insurance Employee"
interactions = create a "Customer", update a "Customer", "offer" a "Contract"
benefit = "I am able to manage the customers data and offer them insurance contracts."
}
6 changes: 6 additions & 0 deletions _cmls/lang-ref-use-case-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="highlight"><pre><span></span><span class="k">UseCase</span> UC1_Example {
<span class="k">actor</span> = <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">interactions</span> = <span class="k">create</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="k">update</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">benefit</span> = <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}
</pre></div>
7 changes: 7 additions & 0 deletions _cmls/lang-ref-user-story-1.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UserStory US1_Example {
As an "Insurance Employee"
I want to "create" a "Customer"
I want to "update" a "Customer"
I want to "offer" a "Contract"
so that "I am able to manage the customers data and offer them insurance contracts."
}
8 changes: 8 additions & 0 deletions _cmls/lang-ref-user-story-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="highlight"><pre><span></span><span class="k">UserStory</span> US1_Example {
<span class="k">As</span> <span class="k">an</span> <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;update&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">so</span> <span class="k">that</span> <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}
</pre></div>
9 changes: 9 additions & 0 deletions _cmls/rapid-ooad-listing-1.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
UserStory US1_Example {
As an "Insurance Employee" I want to "create" a "Customer" so that "I am able to manage customer data ..."
}

UseCase UC1_Example {
actor = "Insurance Employee"
interactions = "create" a "Customer"
benefit = "I am able to manage customer data ..."
}
10 changes: 10 additions & 0 deletions _cmls/rapid-ooad-listing-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="highlight"><pre><span></span><span class="k">UserStory</span> US1_Example {
<span class="k">As</span> <span class="k">an</span> <span class="s">&quot;Insurance Employee&quot;</span> <span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span> <span class="k">so</span> <span class="k">that</span> <span class="s">&quot;I am able to manage customer data ...&quot;</span>
}

<span class="k">UseCase</span> UC1_Example {
<span class="k">actor</span> = <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">interactions</span> = <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">benefit</span> = <span class="s">&quot;I am able to manage customer data ...&quot;</span>
}
</pre></div>
13 changes: 13 additions & 0 deletions _cmls/rapid-ooad-listing-2.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
UserStory US1_Example {
As an "Insurance Employee"
I want to "create" a "Customer"
I want to "update" a "Customer"
I want to "offer" a "Contract"
so that "I am able to manage the customers data and offer them insurance contracts."
}

UseCase UC1_Example {
actor = "Insurance Employee"
interactions = "create" a "Customer", "update" a "Customer", "offer" a "Contract"
benefit = "I am able to manage the customers data and offer them insurance contracts."
}
14 changes: 14 additions & 0 deletions _cmls/rapid-ooad-listing-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="highlight"><pre><span></span><span class="k">UserStory</span> US1_Example {
<span class="k">As</span> <span class="k">an</span> <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;update&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">so</span> <span class="k">that</span> <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}

<span class="k">UseCase</span> UC1_Example {
<span class="k">actor</span> = <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">interactions</span> = <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="s">&quot;update&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">benefit</span> = <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}
</pre></div>
12 changes: 12 additions & 0 deletions _cmls/rapid-ooad-listing-3.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Domain InsuranceDomain {
Subdomain CustomerDomain {
domainVisionStatement "Aims at promoting the following benefit for a Insurance Employee: I am able to manage the customers data and offer them insurance contracts."
Entity Customer
Entity Contract
Service US1_ExampleService {
createCustomer;
updateCustomer;
offerContract;
}
}
}
13 changes: 13 additions & 0 deletions _cmls/rapid-ooad-listing-3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="highlight"><pre><span></span><span class="k">Domain</span> InsuranceDomain {
<span class="k">Subdomain</span> CustomerDomain {
<span class="k">domainVisionStatement</span> <span class="s">&quot;Aims at promoting the following benefit for a Insurance Employee: I am able to manage the customers data and offer them insurance contracts.&quot;</span>
<span class="k">Entity</span> Customer
<span class="k">Entity</span> Contract
<span class="k">Service</span> US1_ExampleService {
createCustomer;
updateCustomer;
offerContract;
}
}
}
</pre></div>
21 changes: 21 additions & 0 deletions _cmls/rapid-ooad-listing-4.cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
BoundedContext NewContextFromSubdomains implements CustomerDomain {
domainVisionStatement "This Bounded Context realizes the following subdomains: CustomerDomain"
/* This Aggregate contains the entities and services of the 'CustomerDomain' subdomain.
* TODO: You can now refactor the Aggregate, for example by using the 'Split Aggregate by Entities' architectural refactoring.
* TODO: Add attributes and operations to the entities.
* TODO: Add operations to the services.
* Find examples and further instructions on our website: https://contextmapper.org/docs/rapid-ooad/ */
Aggregate CustomerDomainAggregate {
Service US1_ExampleService {
CreateCustomerOutput createCustomer (CreateCustomerInput input);
UpdateCustomerOutput updateCustomer (UpdateCustomerInput input);
OfferContractOutput offerContract (OfferContractInput input);
}
Entity Customer {
CustomerID customerId
}
Entity Contract {
ContractID contractId
}
}
}
22 changes: 22 additions & 0 deletions _cmls/rapid-ooad-listing-4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="highlight"><pre><span></span><span class="k">BoundedContext</span> NewContextFromSubdomains <span class="k">implements</span> CustomerDomain {
<span class="k">domainVisionStatement</span> <span class="s">&quot;This Bounded Context realizes the following subdomains: CustomerDomain&quot;</span>
<span class="c">/* This Aggregate contains the entities and services of the &#39;CustomerDomain&#39; subdomain.</span>
<span class="c"> * TODO: You can now refactor the Aggregate, for example by using the &#39;Split Aggregate by Entities&#39; architectural refactoring.</span>
<span class="c"> * TODO: Add attributes and operations to the entities.</span>
<span class="c"> * TODO: Add operations to the services.</span>
<span class="c"> * Find examples and further instructions on our website: https://contextmapper.org/docs/rapid-ooad/ */</span>
<span class="k">Aggregate</span> CustomerDomainAggregate {
<span class="k">Service</span> US1_ExampleService {
CreateCustomerOutput createCustomer (CreateCustomerInput input);
UpdateCustomerOutput updateCustomer (UpdateCustomerInput input);
OfferContractOutput offerContract (OfferContractInput input);
}
<span class="k">Entity</span> Customer {
CustomerID customerId
}
<span class="k">Entity</span> Contract {
ContractID contractId
}
}
}
</pre></div>
5 changes: 5 additions & 0 deletions _data/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@
- knowledge-level
- aggregate
- tactic-ddd
- user-requirements
- imports

- title: Analysis and Design Transformations
docs:
- rapid-ooad

- title: Architectural Refactorings (ARs)
docs:
- architectural-refactorings
Expand Down
7 changes: 7 additions & 0 deletions _docs/language-reference/language-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ The following patterns can be used in CML models as well (but currently are not

*Note:* Our Aggregate pattern implementation is different from the one in Sculptor; it does not correspond to Sculptor's implementation.
Therefore it is documented [here](/docs/aggregate).

## Additional Language Features
The following (not DDD specific) language features are supported by CML as well:

* **[User Requirements](/docs/user-requirements/)** (Use Cases and User Stories)
* Used for the Architectural Refactoring (AR) [Split Bounded Context by Use Cases](/docs/ar-split-bounded-context-by-use-cases/) and our [Rapid OOAD](/docs/rapid-ooad/) tools.
* **[Imports](/docs/imports/)** to include other CML files
37 changes: 37 additions & 0 deletions _docs/language-reference/user-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: User Requirements
permalink: /docs/user-requirements/
---

As described in our [Rapid Object-oriented Analysis and Design](/docs/modeling-tools/rapid-ooad/) page, the CML syntax supports the specification of user stories and use cases.
One can then derive DDD Subdomains and later Bounded Contexts from these stories and cases.

The following examples illustrate the syntax for both concepts quickly. Both concepts allow to specify the _actor_/_user_, the _interactions_ (_so that I can_ part of user story),
and the _benefit_ of a use case or user story.

## Use Case
The syntax to declare a use case rather briefly is as follows:

<div class="highlight"><pre><span></span><span class="k">UseCase</span> UC1_Example {
<span class="k">actor</span> = <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">interactions</span> = <span class="k">create</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="k">update</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>, <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">benefit</span> = <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}
</pre></div>

The predicate (verb) in the `interaction` can be one of the keywords `create`, `read`, `update`, `delete` (CRUD), or any string.

## User Story
First and foremost, a user story is an invitation to communicate and collaborate, as well a planning item. That said, the [role-feature-reason template](https://www.agilealliance.org/glossary/user-story-template/) can also serve as a requirements specification element. Hence, the user story support in CML allows you to declare exactly the same information as seen in the use case above, but in another syntax:

<div class="highlight"><pre><span></span><span class="k">UserStory</span> US1_Example {
<span class="k">As</span> <span class="k">an</span> <span class="s">&quot;Insurance Employee&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;create&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;update&quot;</span> <span class="k">a</span> <span class="s">&quot;Customer&quot;</span>
<span class="k">I</span> <span class="k">want</span> <span class="k">to</span> <span class="s">&quot;offer&quot;</span> <span class="k">a</span> <span class="s">&quot;Contract&quot;</span>
<span class="k">so</span> <span class="k">that</span> <span class="s">&quot;I am able to manage the customers data and offer them insurance contracts.&quot;</span>
}
</pre></div>

*Note:* As you can see above, both variants allow users to specify multiple _interactions_ or _I want to_ parts in one use case or user story. You can see this as a way of
expressing related features, for instance those originating from splitting a larger story - or the steps in a use case scenario.
Loading