Skip to content

An order model grows

A class diff. The domain model gains a Discount class and its relation, and a cardinality and two members change.

The domain model gains a Discount class and its relation, and a cardinality and two members changeThe domain model gains a Discount class and its relation, and a cardinality and two members change
The version before the change: Order, LineItem, Product, Customer, Address and Payment.The version before the change: Order, LineItem, Product, Customer, Address and Payment.
Before
The version after the change: Order, LineItem, Product, Customer, Address, Payment and Discount.The version after the change: Order, LineItem, Product, Customer, Address, Payment and Discount.
After

Spec

domain-change.v1.json
{
"type": "class",
"theme": "default",
"legend": true,
"classes": [
{
"id": "order",
"label": "Order",
"attributes": [
{"visibility": "-", "text": "id: string"},
{"visibility": "-", "text": "placedAt: Date"}
],
"methods": [{"visibility": "+", "text": "total(): Money"}]
},
{
"id": "item",
"label": "LineItem",
"attributes": [
{"visibility": "-", "text": "quantity: int"},
{"visibility": "-", "text": "price: Money"}
]
},
{
"id": "product",
"label": "Product",
"attributes": [
{"visibility": "-", "text": "sku: string"},
{"visibility": "-", "text": "name: string"}
]
},
{
"id": "customer",
"label": "Customer",
"attributes": [
{"visibility": "-", "text": "name: string"},
{"visibility": "-", "text": "email: string"}
]
},
{
"id": "address",
"label": "Address",
"attributes": [
{"visibility": "-", "text": "street: string"},
{"visibility": "-", "text": "city: string"}
]
},
{
"id": "payment",
"label": "Payment",
"attributes": [
{"visibility": "-", "text": "method: string"},
{"visibility": "-", "text": "amount: Money"}
]
}
],
"relations": [
{
"id": "contains",
"from": "order",
"to": "item",
"kind": "composition",
"from_card": "1",
"to_card": "1..*",
"label": "contains"
},
{
"id": "references",
"from": "item",
"to": "product",
"kind": "association",
"from_card": "*",
"to_card": "1",
"label": "references"
},
{
"id": "places",
"from": "customer",
"to": "order",
"kind": "aggregation",
"from_card": "1",
"to_card": "*",
"label": "places"
},
{
"id": "ships-to",
"from": "customer",
"to": "address",
"kind": "composition",
"from_card": "1",
"to_card": "1..*",
"label": "ships to"
},
{
"id": "settled-by",
"from": "order",
"to": "payment",
"kind": "composition",
"from_card": "1",
"to_card": "1",
"label": "settled by"
}
]
}

Draw it yourself

Terminal window
diago diff domain-change.v1.json domain-change.v2.json > domain-change.diff.svg

Open it in the playground to edit it in your browser.