its all about the domain honey

51
WPS - Workplace Solutions GmbH //// Hans-Henny-Jahnn-Weg 29 //// 22085 HAMBURG IT’S ALL ABOUT THE DOMAIN, HONEY - Erfahrungen aus 10 Jahren Domain Driven Design Dr. Carola Lilienthal, [email protected], @cairolali www.wps.de

Upload: carola-lilienthal

Post on 11-Apr-2017

177 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Its all about the domain honey

WPS - Workplace Solutions GmbH //// Hans-Henny-Jahnn-Weg 29 //// 22085 HAMBURG

IT’S ALL ABOUT THE DOMAIN, HONEY - Erfahrungen aus 10 Jahren Domain Driven Design

Dr. Carola Lilienthal, [email protected], @cairolaliwww.wps.de

Page 2: Its all about the domain honey

03.05.2023 //// Seite 3WPS - Workplace Solutions GmbH

Software-Architektur

Anforderungs-ermittlung

Leitstand und Interaktion

Individual-software

Business-Software,die Spaß macht!

WPS – Workplace Solutions GmbH

Page 3: Its all about the domain honey

Foto

: J. R

ost

Page 4: Its all about the domain honey

03.05.2023 //// Seite 5WPS - Workplace Solutions GmbH

Dr. Carola LilienthalGeschäftsführerin

[email protected]

+49 40 229 499-0+49 40 229 499-299+49 170 184 77 11

Diplom-Informatikerin

@cairolali

a

@[email protected]

Page 5: Its all about the domain honey

Schulung Domain-Driven DesignModul für Advanced Level

wps.de/ddd

Page 6: Its all about the domain honey

03.05.2023 //// Seite 7WPS - Workplace Solutions GmbH

WIR SIND PROGRAMMIERER...

Page 7: Its all about the domain honey

03.05.2023 //// Seite 8WPS - Workplace Solutions GmbH

... UND WIR LIEBEN TECHNIK

Page 8: Its all about the domain honey

03.05.2023 //// Seite 9WPS - Workplace Solutions GmbH

SOFTWARE != SELBSTZWECK

Software ist ein Mittel zum ZweckKein SelbstzweckDas Ziel ist das Ziel

Page 9: Its all about the domain honey

03.05.2023 //// Seite 10WPS - Workplace Solutions GmbH

SOFTWARE UND DOMÄNE

Schreibe Software, die tief in der Domäne verwurzelt ist!

Software

Domäne

Page 10: Its all about the domain honey

03.05.2023 //// Seite 11WPS - Workplace Solutions GmbH

DOMAIN DRIVEN DESIGN ANWENDEN

Zu Beginn eines Softwareprojekts: Fokussiere die Domäne in der die Software eingesetzt wird

Wie erschafft man Software, die zu einer Domäne passt? Begreife Software als Reflektion

der Domäne Lasse Kernkonzepte und

Elemente der Domäne in die Software einfließen

Realisiere ihre Zusammenhänge

Erstelle ein Domänenmodell

Page 11: Its all about the domain honey

03.05.2023 //// Seite 12WPS - Workplace Solutions GmbH

TECHNISCHE SPRACHE

X

Class

Database

Server

Client

O/R-MappingInheritan

ce

A

B

Method

Interface

LinuxWindow

s

EclipseVisual Studio

Page 12: Its all about the domain honey

03.05.2023 //// Seite 13WPS - Workplace Solutions GmbH

DOMÄNEN-SPRACHE

Container

Containernummer

4300

Kran

Twistlock

Konnossement

Beispiel: Hafen

Page 13: Its all about the domain honey

03.05.2023 //// Seite 14WPS - Workplace Solutions GmbH

Fach-sprach

eTechno Babble

?

UBIQUITOUS LANGUAGE

Page 14: Its all about the domain honey

03.05.2023 //// Seite 15WPS - Workplace Solutions GmbH

Fach-sprach

eTechno Babble

Fach-sprach

e

UBIQUITOUS LANGUAGE

Page 15: Its all about the domain honey

03.05.2023 //// Seite 16WPS - Workplace Solutions GmbH

Fach-sprach

eTechno Babble

UBIQUITOUS LANGUAGE

Page 16: Its all about the domain honey

03.05.2023 //// Seite 17WPS - Workplace Solutions GmbH

Techno Babble

Fach-sprach

e

UBIQUITOUS LANGUAGE

Page 17: Its all about the domain honey

03.05.2023 //// Seite 18WPS - Workplace Solutions GmbH

Fach-sprach

e

{Techno Babble}

?

UBIQUITOUS LANGUAGE

Page 18: Its all about the domain honey

03.05.2023 //// Seite 19WPS - Workplace Solutions GmbH

Fach-sprach

e

{Fach-sprache}

UBIQUITOUS LANGUAGE

Page 19: Its all about the domain honey

03.05.2023 //// Seite 20WPS - Workplace Solutions GmbH

UBIQUITOUS LANGUAGE

Verwende die gemeinsame Sprache in.. der Kommunikation

mündlich schriftlich grafisch

im Code

Im Grunde genommen überall Deswegen nennt sich die Fachsprache allgegenwärtig.

Page 20: Its all about the domain honey

03.05.2023 //// Seite 21WPS - Workplace Solutions GmbH

SPRACHE TAUCHT NICHT EINFACH AUF

Es braucht Wochen bis Monate... harter Arbeit und scharfem Fokus

… um die Schlüsselkonzepte offenzulegen.

Die ersten Wörter einer allgemeinen Fachsprache kommen üblicherweise direkt aus der Domäne

Im Laufe der Entwicklung werden neue Begriffe definiert und hinzugefügt

Page 21: Its all about the domain honey

03.05.2023 //// Seite 22WPS - Workplace Solutions GmbH

DOMÄNEN-SPRACHE

Brett

König

Figuren

Spieler

Schachuhr

Page 22: Its all about the domain honey

03.05.2023 //// Seite 23WPS - Workplace Solutions GmbH

ALLGEGENWÄRTIGE FACHSPRACHE

Brett

Figuren

SpielerNichtmenschlich

er Spieler

Page 23: Its all about the domain honey

03.05.2023 //// Seite 24WPS - Workplace Solutions GmbH

SPRACHEN SIND LEBENDIG

Experimentiere mit alternativen Ausdrucksformen Das Modell und die Sprache entwickeln sich weiter

Überarbeite dann den Code Benenne Klassen, Methoden, Module Entspreche dem neuen Modell

Eine Sprache will gesprochen werden: Beseitige Unklarheiten durch Konversation

Page 24: Its all about the domain honey

03.05.2023 //// Seite 25WPS - Workplace Solutions GmbH

Page 25: Its all about the domain honey

03.05.2023 //// Seite 26WPS - Workplace Solutions GmbH

GLOSSAR

Fachsprache der Benutzer/Ubiquitous Language• bereits existierende Begriffe• rekonstruierte Begriffe• neue Begriffsbildungen

•Wer tut was damit wozu?

Kernkonzepte

Wichtiger am Anfang des Projektes Oft Wegwerfprodukt

Page 26: Its all about the domain honey

03.05.2023 //// Seite 27WPS - Workplace Solutions GmbH

WIE LERNEN WIR DIE FACHLICHKEIT?

Durch die Fachexperten (domain experts) Sie haben das Wissen

Worum es bei ihrer Arbeit geht Wo die Software sie unterstützen kann

Auch wenn sie das Wissen nicht selbständig aufschreiben bzw. abstrahieren können

Wer die Fachlichkeit nichtversteht, kann ihr nicht helfen

Softwareentwickler undFachexperten bilden zusammen das Team

Page 27: Its all about the domain honey

03.05.2023 //// Seite 28WPS - Workplace Solutions GmbH

WIE KOMMEN WIR AN DAS WISSEN DER FACHEXPERTEN?

Welche Techniken gibt es? Interviews

Use Cases + Szenarien Workshops

Event Storming Domain Storytelling

Das wollen wir

extrahieren!Fach-

wissen

Page 28: Its all about the domain honey

03.05.2023 //// Seite 29WPS - Workplace Solutions GmbH

WORKSHOPS MIT ANWENDERN UND PRODUCT OWNERN

“Georgia?” by The Library of Congress, flickr.com

• Teilnehmer aus verschiedenen Bereichen (Business, IT, Management, …)

• ein Moderator für den Workshop direktes Feedback von allen Beteiligten

Page 29: Its all about the domain honey

03.05.2023 //// Seite 30WPS - Workplace Solutions GmbH

EVENT STORMING

Eine Methode um Geschäftsprozesse zu modellieren

Modelliert werden:Domain EventsCommandsActeureAggregate

Page 30: Its all about the domain honey

03.05.2023 //// Seite 31WPS - Workplace Solutions GmbH

DOMAIN STORYTELLING

www.domainstorytelling.org

Modelliert werden:AkteureGegenständeHandlungen

Page 31: Its all about the domain honey

03.05.2023 //// Seite 32WPS - Workplace Solutions GmbH

Page 32: Its all about the domain honey

03.05.2023 //// Seite 33WPS - Workplace Solutions GmbH

TAKTISCHES UND STRATEGISCHES MODELLIEREN

DDD gibt Anleitung für Modellierung im Großen und im Kleinen Strategisches Modellieren

Teile die Domäne in getrennte Bounded Contexts auf Jeder BC hat sein eigenes Fachmodell und seine eigene

Allgegenwärtige Sprache Context Mapping hilft die Beziehungen zwischen Bounded Contexts

zu verstehen

Taktisches Modellieren Innerhalb eines Bounded Context Building Blocks: Entity, Value Object,

Aggregate, Service, Repository, Factory

Page 33: Its all about the domain honey

03.05.2023 //// Seite 34WPS - Workplace Solutions GmbH

GROSSE PROJEKTE

Erfordern mehrere Teams Entwicklung findet parallel statt Jedes Team korrespondiert mit einem Teil des Modells

Ein großes Modell?

Page 34: Its all about the domain honey

03.05.2023 //// Seite 35WPS - Workplace Solutions GmbH

DAS GROSSE VEREINHEITLICHTE MODELL

Umfasst die vollständige Domäne eines Unternehmens Ein schwer erreichbares Ideal Oft nicht lohnenswert anzuvisieren

Hoher Koordinationsaufwand in TeamsFührt oft zu einem big ball of mud

Page 35: Its all about the domain honey

03.05.2023 //// Seite 36WPS - Workplace Solutions GmbH

KONTEXTGRENZEN (BOUNDED CONTEXT)

Jedes Modell hat einen Kontext Kontext = Grundsätzliche Voraussetzungen, damit Begriffe eine

bestimmte Bedeutung erhalten Wird ein Modell aufgespalten, so ist für jedes Teilmodell eine

Kontextdefinition erforderlich

Setze explizite Grenzen in der… Organisation von Teams Benutzung von Teilen der

Applikation Codebasis Entwicklung von

Datenbank-Schemas

Page 36: Its all about the domain honey

03.05.2023 //// Seite 37WPS - Workplace Solutions GmbH

WIE SCHNEIDE ICH MEINE DOMÄNE?

Nach Unterschieden in der Verwendung von Begriffen der Ubiquitous Language

Nach Grenzen im Geschäftsprozess, die die Domänenexperten beschreiben

Nach Abteilungen in der Organisation bzw. Gruppen von Domänenexperten

NICHT: Nach Entities oder Aggregaten!

Page 37: Its all about the domain honey

03.05.2023 //// Seite 38WPS - Workplace Solutions GmbH

BEISPIEL – BOUNDED CONTEXTENACH ABTEILUNG UND NACH PROZESS

VERTRIEB

Buchhaltung

HRLohnbuchhaltungRecruiting

Vertrieb

Page 38: Its all about the domain honey

03.05.2023 //// Seite 39WPS - Workplace Solutions GmbH

LIVING IN A BOX

Erhalte die Konsistenz innerhalb der Grenzen Keine Ablenkung durch äußere Angelegenheiten

Freie Gestaltung eines Teilmodells durch das zugehörige Team Kenne die Restriktionen Bleibe innerhalb der Modellgrenzen

Page 39: Its all about the domain honey

03.05.2023 //// Seite 40WPS - Workplace Solutions GmbH

JEDER BOUNDED CONTEXT HAT SEIN EIGENES MODELL

Bewegung

Kosmetik

Page 40: Its all about the domain honey

03.05.2023 //// Seite 41WPS - Workplace Solutions GmbH

Subdomänen Kern (Core Domain) Unterstützende (Supporting

Domain) Allgemeine (Generic Domain)

Context Mapping Shared Kernel Customer/Supplier Open-Host-Service Published Language Separate Ways Anticorruption Layer

STRATEGISCHES DESIGN – WEITERE BEGRIFFE

Page 41: Its all about the domain honey

03.05.2023 //// Seite 42WPS - Workplace Solutions GmbH

DER PREIS FÜR DOMÄNENMODELLE

Zusätzliche Arbeit Definition der Modellgrenzen Definition der Beziehungen zwischen verschiedenen Modellen

(Context Mapping) Abbildungen zwischen verschiedenen Modellen Objekte können nicht zwischen den BC transportiert werden

Page 42: Its all about the domain honey

03.05.2023 //// Seite 43WPS - Workplace Solutions GmbH

WAS WIR NICHT BAUEN WOLLEN

✘ANEMIC DOMAIN MODEL

„blutarme“ fachliche Objekte Schnittstelle ohne Aussagekraft

aus Gettern/Settern Viele String Parameter

Eigentliche Fachlichkeit außerhalb Entities + Value Objects in Services oder im UI

Viele Util, Helper und Manager Klassen

Page 43: Its all about the domain honey

03.05.2023 //// Seite 44WPS - Workplace Solutions GmbH

ANEMIC FEHLENDE ROBUSTHEIT

Designschulden Unklarer, schwer

verständlicher Entwurf Verteilte Fachlichkeit Copy & Paste -

Programmierung

Teure Wartung Duplizierter Code Viele Refactorings Schlechte Testbarkeit

Page 44: Its all about the domain honey

03.05.2023 //// Seite 45WPS - Workplace Solutions GmbH

UNKLARE STRUKTUREN IN DER ACHITEKTUR

Page 45: Its all about the domain honey

03.05.2023 //// Seite 46WPS - Workplace Solutions GmbH

GROSSE ZYKLEN VERSCHMUTZEN DAS SYSTEM

463 classes from 10 different domain-specific modules

Page 46: Its all about the domain honey

03.05.2023 //// Seite 47WPS - Workplace Solutions GmbH

Page 47: Its all about the domain honey

03.05.2023 //// Seite 48WPS - Workplace Solutions GmbH

119 Klassen aus 4 Komponenten

+ 28 weitere Klassen

Page 48: Its all about the domain honey

03.05.2023 //// Seite 49WPS - Workplace Solutions GmbH

Große Zyklen sichtbar machen

327 Klassen aus 8 Komponenten

brauchen sich gegenseitig

Page 49: Its all about the domain honey

03.05.2023 //// Seite 50WPS - Workplace Solutions GmbH

Page 50: Its all about the domain honey

03.05.2023 //// Seite 51WPS - Workplace Solutions GmbH

Page 51: Its all about the domain honey

03.05.2023 //// Seite 52WPS - Workplace Solutions GmbH

Dr. Carola LilienthalGeschäftsführerin

[email protected]

+49 40 229 499-0+49 40 229 499-299+49 170 184 77 11

Diplom-Informatikerin

@cairolali

a

@[email protected]

Vielen Dank für Ihre Aufmerksamkeit!