Onion-Architecture-diagram.excalidraw

==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠==

Text Elements

Domain Model ^om1 Entities, Value Objects, Domain Events ^om2 Domain Services ^os1 Aggregate logic, Domain interfaces ^os2 Application Services ^oa1 Use cases, DTOs, Ports ^oa2 Infrastructure & UI ^oi1 DB, Web Framework, External Services, UI ^oi2 depends on ^odep1 depends on ^odep2 depends on ^odep3 vs Clean Architecture: Onion names Domain Services explicitly as a separate ring. Clean Architecture merges them into Use Cases. ^callout

%%

Drawing

{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {
      "id": "oring4",
      "type": "ellipse",
      "x": 100,
      "y": 100,
      "width": 800,
      "height": 800,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "#d0ebff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3001,
      "version": 1,
      "versionNonce": 3001,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false
    },
    {
      "id": "oring3",
      "type": "ellipse",
      "x": 200,
      "y": 200,
      "width": 600,
      "height": 600,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3002,
      "version": 1,
      "versionNonce": 3002,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false
    },
    {
      "id": "oring2",
      "type": "ellipse",
      "x": 300,
      "y": 300,
      "width": 400,
      "height": 400,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "#ffe8cc",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3003,
      "version": 1,
      "versionNonce": 3003,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false
    },
    {
      "id": "oring1",
      "type": "ellipse",
      "x": 400,
      "y": 400,
      "width": 200,
      "height": 200,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "#fff3bf",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3004,
      "version": 1,
      "versionNonce": 3004,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false
    },
    {
      "id": "olabel-domain-model",
      "type": "text",
      "x": 420,
      "y": 465,
      "width": 160,
      "height": 50,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3005,
      "version": 1,
      "versionNonce": 3005,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "Domain Model\nEntities, Value Objects,\nDomain Events",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 44,
      "containerId": null,
      "originalText": "Domain Model\nEntities, Value Objects,\nDomain Events"
    },
    {
      "id": "olabel-domain-services",
      "type": "text",
      "x": 330,
      "y": 355,
      "width": 160,
      "height": 50,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3006,
      "version": 1,
      "versionNonce": 3006,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "Domain Services\nAggregate logic,\nDomain interfaces",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 44,
      "containerId": null,
      "originalText": "Domain Services\nAggregate logic,\nDomain interfaces"
    },
    {
      "id": "olabel-app-services",
      "type": "text",
      "x": 230,
      "y": 250,
      "width": 160,
      "height": 50,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3007,
      "version": 1,
      "versionNonce": 3007,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "Application Services\nUse cases, DTOs, Ports",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 44,
      "containerId": null,
      "originalText": "Application Services\nUse cases, DTOs, Ports"
    },
    {
      "id": "olabel-infra",
      "type": "text",
      "x": 130,
      "y": 150,
      "width": 200,
      "height": 50,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3008,
      "version": 1,
      "versionNonce": 3008,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "Infrastructure & UI\nDB, Web Framework,\nExternal Services, UI",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 44,
      "containerId": null,
      "originalText": "Infrastructure & UI\nDB, Web Framework,\nExternal Services, UI"
    },
    {
      "id": "oarrow1",
      "type": "arrow",
      "x": 870,
      "y": 500,
      "width": 100,
      "height": 0,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3009,
      "version": 1,
      "versionNonce": 3009,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "points": [[0, 0], [-100, 0]],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "olabel-dep1",
      "type": "text",
      "x": 875,
      "y": 480,
      "width": 90,
      "height": 16,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3010,
      "version": 1,
      "versionNonce": 3010,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "depends on",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 12,
      "containerId": null,
      "originalText": "depends on"
    },
    {
      "id": "oarrow2",
      "type": "arrow",
      "x": 770,
      "y": 540,
      "width": 80,
      "height": 0,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3011,
      "version": 1,
      "versionNonce": 3011,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "points": [[0, 0], [-80, 0]],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "olabel-dep2",
      "type": "text",
      "x": 775,
      "y": 520,
      "width": 90,
      "height": 16,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3012,
      "version": 1,
      "versionNonce": 3012,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "depends on",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 12,
      "containerId": null,
      "originalText": "depends on"
    },
    {
      "id": "oarrow3",
      "type": "arrow",
      "x": 670,
      "y": 580,
      "width": 60,
      "height": 0,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3013,
      "version": 1,
      "versionNonce": 3013,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "points": [[0, 0], [-60, 0]],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "olabel-dep3",
      "type": "text",
      "x": 675,
      "y": 560,
      "width": 90,
      "height": 16,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3014,
      "version": 1,
      "versionNonce": 3014,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "depends on",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "baseline": 12,
      "containerId": null,
      "originalText": "depends on"
    },
    {
      "id": "callout-box",
      "type": "rectangle",
      "x": 950,
      "y": 300,
      "width": 340,
      "height": 100,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "#f8f9fa",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "dashed",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3015,
      "version": 1,
      "versionNonce": 3015,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false
    },
    {
      "id": "callout-text",
      "type": "text",
      "x": 958,
      "y": 315,
      "width": 324,
      "height": 70,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": null,
      "seed": 3016,
      "version": 1,
      "versionNonce": 3016,
      "isDeleted": false,
      "boundElements": null,
      "updated": 1,
      "link": null,
      "locked": false,
      "text": "vs Clean Architecture:\nOnion names Domain Services explicitly\nas a separate ring. Clean Architecture\nmerges them into Use Cases.",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "baseline": 64,
      "containerId": null,
      "originalText": "vs Clean Architecture:\nOnion names Domain Services explicitly\nas a separate ring. Clean Architecture\nmerges them into Use Cases."
    }
  ],
  "appState": {
    "gridSize": null,
    "viewBackgroundColor": "#ffffff"
  },
  "files": {}
}

%%