Payments after the redesign
Payments after a redesign: the order and its dependency on the payment interface are critical, the wallet payment and the composition with the receipt planned, the paper invoice and the relation to it deprecated — drawn with the same colors, badges and line patterns as roles in flow and architecture diagrams. A relation keeps its marks: the planned composition with the receipt keeps its filled diamond. The legend names the roles used, the description lists them.
Payments after the redesign
examples/payment-redesign.json{
"schemaVersion": 1,
"type": "classes",
"title": "Payments after the redesign",
"source": "Illustrative domain model",
"width": 900,
"height": 600,
"classes": {
"classes": [
{
"id": "order",
"label": "Order",
"attributes": [
"+ id: Int",
"+ total: Money"
],
"methods": [
"+ pay(): Receipt"
],
"role": "critical"
},
{
"id": "payment",
"label": "Payment",
"kind": "interface",
"methods": [
"+ charge(amount: Money): Receipt"
]
},
{
"id": "card",
"label": "CardPayment",
"attributes": [
"- token: String"
],
"methods": [
"+ charge(amount: Money): Receipt"
]
},
{
"id": "wallet",
"label": "WalletPayment",
"attributes": [
"- walletId: String"
],
"methods": [
"+ charge(amount: Money): Receipt"
],
"role": "planned"
},
{
"id": "invoice",
"label": "PaperInvoice",
"attributes": [
"+ number: String",
"+ dueAt: Date"
],
"role": "deprecated"
},
{
"id": "receipt",
"label": "Receipt",
"attributes": [
"+ id: String",
"+ paidAt: Date"
]
}
],
"relations": [
{
"from": "order",
"to": "payment",
"kind": "dependency",
"label": "paid by",
"role": "critical"
},
{
"from": "card",
"to": "payment",
"kind": "realization"
},
{
"from": "wallet",
"to": "payment",
"kind": "realization"
},
{
"from": "order",
"to": "invoice",
"fromCardinality": "1",
"toCardinality": "0..1",
"role": "deprecated"
},
{
"from": "order",
"to": "receipt",
"kind": "composition",
"fromCardinality": "1",
"toCardinality": "0..*",
"role": "planned"
}
]
}
}Focus
Source: Illustrative domain model
Show chart data
| Item | Kind | Role | Attributes | Methods | Relations |
|---|---|---|---|---|---|
| Order | Class | critical | + id: Int; + total: Money | + pay(): Receipt | depends on Payment [paid by] (critical); is associated with PaperInvoice (1 : 0..1) (deprecated); is composed of Receipt (1 : 0..*) (planned) |
| Payment | Interface | + charge(amount: Money): Receipt | |||
| CardPayment | Class | - token: String | + charge(amount: Money): Receipt | implements Payment | |
| WalletPayment | Class | planned | - walletId: String | + charge(amount: Money): Receipt | implements Payment |
| PaperInvoice | Class | deprecated | + number: String; + dueAt: Date | ||
| Receipt | Class | + id: String; + paidAt: Date |