chartletv0.21.0chartlet.casoon.de

← All examples

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
Payments after the redesign
Payments after the redesignClass diagram with 6 classes and 5 relations. Most connected: Order and Payment (3 connections each). Order: 2 attributes, 1 method. Order depends on Payment [paid by]; is associated with PaperInvoice (1 : 0..1); is composed of Receipt (1 : 0..*). Payment: 0 attributes, 1 method. CardPayment: 1 attribute, 1 method. CardPayment implements Payment. WalletPayment: 1 attribute, 1 method. WalletPayment implements Payment. PaperInvoice: 2 attributes, 0 methods. Receipt: 2 attributes, 0 methods. Roles: critical: Order, Order → Payment; planned: WalletPayment, Order → Receipt; deprecated: PaperInvoice, Order → PaperInvoice.Order → Payment: paid byPayment → CardPaymentPayment → WalletPaymentOrder → PaperInvoice0..11Order → Receipt0..*1paid byOrderOrder+ id: Int+ total: Money+ pay(): Receipt!Payment – «interface»«interface»Payment+ charge(amount: Money): ReceiptCardPaymentCardPayment- token: String+ charge(amount: Money): ReceiptWalletPaymentWalletPayment- walletId: String+ charge(amount: Money): Receipt+PaperInvoicePaperInvoice+ number: String+ dueAt: Date−ReceiptReceipt+ id: String+ paidAt: Date!Critical+Planned−Deprecated

Source: Illustrative domain model

Show chart data
Data for Payments after the redesign
ItemKindRoleAttributesMethodsRelations
OrderClasscritical+ id: Int; + total: Money+ pay(): Receiptdepends on Payment [paid by] (critical); is associated with PaperInvoice (1 : 0..1) (deprecated); is composed of Receipt (1 : 0..*) (planned)
PaymentInterface+ charge(amount: Money): Receipt
CardPaymentClass- token: String+ charge(amount: Money): Receiptimplements Payment
WalletPaymentClassplanned- walletId: String+ charge(amount: Money): Receiptimplements Payment
PaperInvoiceClassdeprecated+ number: String; + dueAt: Date
ReceiptClass+ id: String; + paidAt: Date
  • Class diagram with roles
  • Show what a redesign changes in a model