SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
qaware.de
Clean Architecture
Eine praktische Herangehensweise
Dirk Kröhan
dirk.kroehan@qaware.de
QAware | 2
Dirk Kröhan
Software Architect
#qaware #mainz
#cloudnative #spring
#architektur
Motivation
QAware | 4
QAware | 5
Bekannte Probleme & die Suche nach dem heiligen Gral
■ Architekturentscheidungen werden früh getroffen
■ Datenbank steht im Zentrum
■ Fachlichkeit verstreut
■ Dinge zu finden ist schwierig
■ Fehlende Strukturen
■ Transiente Bugs treten öfter auf
■ Aufwand für Änderungen & neue Features steigt
■ Schwergewichtige / langsame Tests
QAware | 6
Siehe auch: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html (August 2012)
Wozu brauchen wir Architektur?
QAware | 8
Architektur
als Publikumsmagnet
QAware | 9
The rules of software architecture...
... are the rules of ordering
and assembling
the building blocks of programs.
- Clean Architecture -
“It works” - Reicht das nicht?
QAware | 10
■ "It works" ist oft schnell zusammengebastelt
■ Ein paar Libraries zusammenstecken -> Fertig
■ Copy&Paste StackOverflow Lösung
■ No-Code- / Low-Code-Editor
■ Compiler braucht keine Architektur
QAware | 11
Das Problem
QAware | 12
Das Problem
Der Mensch als Bottleneck
QAware | 13
■ Software wird von Menschen gebaut
■ Kognitive Fähigkeiten sind limitiert
– Max. Methodenlänge
– Größe einer Klasse
– Komplexität einer Komponente
– Größe eines Systems
QAware | 14
If you think good architecture is
expensive,
try bad architecture.
- Brian Foote and Joseph Yoder -
QAware | 15
Feature
Feature
Release
Feature
Release
Feature
Release
Feature
Release
Release
QAware | 16
The only way to go fast, is to go well.
- Robert C. Martin -
Was ist eine gute Architektur? 🤔
The goal of software architecture is
to minimize the human resources
required to build and maintain the
required system.
- Clean Architecture -
QAware | 18
Messbarkeit von guter Architektur
Messbarkeit von gutem Softwaredesing
QAware | 20
Aufwand um Anforderungen umzusetzen
■ Aufwand gering und bleibt über die Zeit gering → gute Architektur
■ Aufwand steigt mit jedem weiteren Release → schlechte Architektur
Gute Architektur lebt!
QAware | 21
Eine gute Architektur ist mehr als Reise
denn als Ziel zu verstehen, mehr als ein
fortlaufender Prozess denn als ein starres
Artefakt.
Eine gute Architektur soll mir helfen ...
QAware | 22
■ ... ohne viel Aufwand zu verstehen, was ein Service tut.
■ ... neue Anforderung in angemessener Zeit umzusetzen.
■ ... mich auf das Wesentliche zu fokussieren.
■ ... technische Entscheidung nicht voreilig treffen zu müssen.
Clean Architecture
Ziele von Clean Architecture
QAware | 24
■ Unabhängigkeit von Frameworks
■ Unabhängigkeit von User-Interfaces
■ Unabhängigkeit von Datenbanken
■ Unabhängigkeit von anderen externen Schnittstellen / Datenquellen
■ Einfache Testbarkeit der Fachlichkeit
The center of your application is not the
database.
Nor is it one or more of the frameworks
you may be using.
The center of your application are
the use cases of your application.
- Robert C. Martin -
QAware | 25
QAware | 26
Quelle: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
QAware | 27
QAware | 28
Dependency
Inversion
Principle
SOLID Principles
QAware | 29
QAware | 30
QAware | 31
QAware | 32
Quelle: https://github.com/mattia-battiston/clean-architecture-example
Und in der Praxis?
QAware | 34
Spring MVC (@RestController), DTOs / Quartz
Mapping-Code: DTOs ←→ Domain Objects
-------------------------------------------------
Fachlichkeit in @Service Klassen,
Domain Entities,
Data Provider Interfaces
------------------------------------------------
Mapping-Code: Domain Objects ←→ DB Entitäten
JPA/Hibernate, SQL Queries, REST-Templates
QAware | 35
candyshop-cleanarchitecture
Was haben wir heute gelernt?
Zusammenfassung
QAware | 38
■ Fokus auf UseCases und Domain → Screaming Architecture
■ Klare Trennung von Fachlichkeit und technischen Details → Bessere Verständlichkeit
■ Fachlichkeit separiert in UseCases → Single Responsability > Don’t repeat yourself
■ Datenbank und Frameworks bleiben ein Detail → Architekturentscheidungen später treffen
■ Einfache Testbarkeit → Unit-Tests der Fachlichkeit (z.B. mit In-Memory Data Provider)
QAware | 39
Der heilige Gral?
It depends!
QAware | 40
■ Keine One-Fits-All Lösung!
– Für Services mit wenig Fachlichkeit (CRUD Services) eeventuell zu hoher Mapping Aufwand
– Gefühlt viel mehr Code Duplizierung (SRP > DRY)
■ “Build your own naming conventions”
■ Höhere Produktivität!
– Klare Struktur & einfachere Verständlichkeit
– Änderungen einfacher möglich
– Siehe auch “What improves developer productivity at google? code quality” (11/2022)
■ Separation of concern: “The center of your application are the use cases of your application”
Green Software Development Community Meetup
The challenge of putting
software sustainability
research into practice
Sandro Kreten
@ QAware in Munich
Jan 19th, 2023 | 18:30
qaware.de
QAware GmbH Mainz
Rheinstraße 4 C
55116 Mainz
Tel. +49 6131 21569-0
info@qaware.de
twitter.com/qaware
linkedin.com/company/qaware-gmbh
xing.com/companies/qawaregmbh
slideshare.net/qaware
github.com/qaware

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
 
Quality in a Square. K8s-native Quality Assurance of Microservices with Testkube
Quality in a Square. K8s-native Quality Assurance of Microservices with TestkubeQuality in a Square. K8s-native Quality Assurance of Microservices with Testkube
Quality in a Square. K8s-native Quality Assurance of Microservices with Testkube
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends Architecture
 
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
 
Chaos Engineering
Chaos EngineeringChaos Engineering
Chaos Engineering
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
Microservices with Spring Boot Tutorial | Edureka
Microservices with Spring Boot Tutorial | EdurekaMicroservices with Spring Boot Tutorial | Edureka
Microservices with Spring Boot Tutorial | Edureka
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Cloud native integration
Cloud native integrationCloud native integration
Cloud native integration
 
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and KnativeBuild and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Gravitee API Management - Ahmet AYDIN
 Gravitee API Management  -  Ahmet AYDIN Gravitee API Management  -  Ahmet AYDIN
Gravitee API Management - Ahmet AYDIN
 
Microservices
MicroservicesMicroservices
Microservices
 
The Modern Database for Enterprise Applications
The Modern Database for Enterprise ApplicationsThe Modern Database for Enterprise Applications
The Modern Database for Enterprise Applications
 
CQRS + Event Sourcing
CQRS + Event SourcingCQRS + Event Sourcing
CQRS + Event Sourcing
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
kubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdf
kubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdfkubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdf
kubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdf
 

Semelhante a Clean Architecture

Enterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue NormalEnterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue Normal
QAware GmbH
 
Enterprise Cloud Native ist das neue Schwarz
Enterprise Cloud Native ist das neue SchwarzEnterprise Cloud Native ist das neue Schwarz
Enterprise Cloud Native ist das neue Schwarz
QAware GmbH
 

Semelhante a Clean Architecture (20)

Make Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform EngineeringMake Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform Engineering
 
Enterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue NormalEnterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue Normal
 
Enterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue NormalEnterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue Normal
 
Enterprise Cloud Native ist das neue Schwarz
Enterprise Cloud Native ist das neue SchwarzEnterprise Cloud Native ist das neue Schwarz
Enterprise Cloud Native ist das neue Schwarz
 
Agile Methoden in der Medizintechnik - Über die Software hinaus (CONSANIS)
Agile Methoden in der Medizintechnik - Über die Software hinaus (CONSANIS)Agile Methoden in der Medizintechnik - Über die Software hinaus (CONSANIS)
Agile Methoden in der Medizintechnik - Über die Software hinaus (CONSANIS)
 
Enterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue NormalEnterprise Cloud Native ist das neue Normal
Enterprise Cloud Native ist das neue Normal
 
Cloud Native Migration: Wie IT-Landschaften ihren Weg auf eine Cloud-Native-P...
Cloud Native Migration: Wie IT-Landschaften ihren Weg auf eine Cloud-Native-P...Cloud Native Migration: Wie IT-Landschaften ihren Weg auf eine Cloud-Native-P...
Cloud Native Migration: Wie IT-Landschaften ihren Weg auf eine Cloud-Native-P...
 
Kontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8s
Kontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8sKontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8s
Kontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8s
 
Applikationsmodernisierung: Der Weg von Legacy in die Cloud
Applikationsmodernisierung: Der Weg von Legacy in die CloudApplikationsmodernisierung: Der Weg von Legacy in die Cloud
Applikationsmodernisierung: Der Weg von Legacy in die Cloud
 
BATbern41 Die Evolution zu Microservices
BATbern41 Die Evolution zu MicroservicesBATbern41 Die Evolution zu Microservices
BATbern41 Die Evolution zu Microservices
 
Kubernetes ist so viel mehr als ein Container Orchestrierer
Kubernetes ist so viel mehr als ein Container OrchestriererKubernetes ist so viel mehr als ein Container Orchestrierer
Kubernetes ist so viel mehr als ein Container Orchestrierer
 
Domain-Driven Design in der Praxis
Domain-Driven Design in der PraxisDomain-Driven Design in der Praxis
Domain-Driven Design in der Praxis
 
Xidra 2016 DevOps
Xidra 2016 DevOpsXidra 2016 DevOps
Xidra 2016 DevOps
 
Roadshow 2018 - Camunda in der Praxis: So geht's
Roadshow 2018 - Camunda in der Praxis: So geht'sRoadshow 2018 - Camunda in der Praxis: So geht's
Roadshow 2018 - Camunda in der Praxis: So geht's
 
Dev Day 2021 - Stephan Pirnbaum - Anwendungsmodernisierung
Dev Day 2021 - Stephan Pirnbaum - AnwendungsmodernisierungDev Day 2021 - Stephan Pirnbaum - Anwendungsmodernisierung
Dev Day 2021 - Stephan Pirnbaum - Anwendungsmodernisierung
 
A Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native StackA Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native Stack
 
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConfA Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
 
30. Treffen der .NET User Group Rhein-Neckar mit Constantin Klein - „Bekommen...
30. Treffen der .NET User Group Rhein-Neckar mit Constantin Klein - „Bekommen...30. Treffen der .NET User Group Rhein-Neckar mit Constantin Klein - „Bekommen...
30. Treffen der .NET User Group Rhein-Neckar mit Constantin Klein - „Bekommen...
 
Nanoservice Architekturen
Nanoservice ArchitekturenNanoservice Architekturen
Nanoservice Architekturen
 
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
 

Mais de QAware GmbH

"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
QAware GmbH
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
QAware GmbH
 

Mais de QAware GmbH (20)

50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf
 
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
 
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN MainzFully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
 
Down the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile ArchitectureDown the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile Architecture
 
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
 
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightDer Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
 
Was kommt nach den SPAs
Was kommt nach den SPAsWas kommt nach den SPAs
Was kommt nach den SPAs
 
Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
 
Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAPKontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
 
Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.
 
Per Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API GatewaysPer Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API Gateways
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 
How to speed up Spring Integration Tests
How to speed up Spring Integration TestsHow to speed up Spring Integration Tests
How to speed up Spring Integration Tests
 

Clean Architecture

  • 1. qaware.de Clean Architecture Eine praktische Herangehensweise Dirk Kröhan dirk.kroehan@qaware.de
  • 2. QAware | 2 Dirk Kröhan Software Architect #qaware #mainz #cloudnative #spring #architektur
  • 5. QAware | 5 Bekannte Probleme & die Suche nach dem heiligen Gral ■ Architekturentscheidungen werden früh getroffen ■ Datenbank steht im Zentrum ■ Fachlichkeit verstreut ■ Dinge zu finden ist schwierig ■ Fehlende Strukturen ■ Transiente Bugs treten öfter auf ■ Aufwand für Änderungen & neue Features steigt ■ Schwergewichtige / langsame Tests
  • 6. QAware | 6 Siehe auch: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html (August 2012)
  • 7. Wozu brauchen wir Architektur?
  • 8. QAware | 8 Architektur als Publikumsmagnet
  • 9. QAware | 9 The rules of software architecture... ... are the rules of ordering and assembling the building blocks of programs. - Clean Architecture -
  • 10. “It works” - Reicht das nicht? QAware | 10 ■ "It works" ist oft schnell zusammengebastelt ■ Ein paar Libraries zusammenstecken -> Fertig ■ Copy&Paste StackOverflow Lösung ■ No-Code- / Low-Code-Editor ■ Compiler braucht keine Architektur
  • 11. QAware | 11 Das Problem
  • 12. QAware | 12 Das Problem
  • 13. Der Mensch als Bottleneck QAware | 13 ■ Software wird von Menschen gebaut ■ Kognitive Fähigkeiten sind limitiert – Max. Methodenlänge – Größe einer Klasse – Komplexität einer Komponente – Größe eines Systems
  • 14. QAware | 14 If you think good architecture is expensive, try bad architecture. - Brian Foote and Joseph Yoder -
  • 16. QAware | 16 The only way to go fast, is to go well. - Robert C. Martin -
  • 17. Was ist eine gute Architektur? 🤔
  • 18. The goal of software architecture is to minimize the human resources required to build and maintain the required system. - Clean Architecture - QAware | 18
  • 19. Messbarkeit von guter Architektur
  • 20. Messbarkeit von gutem Softwaredesing QAware | 20 Aufwand um Anforderungen umzusetzen ■ Aufwand gering und bleibt über die Zeit gering → gute Architektur ■ Aufwand steigt mit jedem weiteren Release → schlechte Architektur
  • 21. Gute Architektur lebt! QAware | 21 Eine gute Architektur ist mehr als Reise denn als Ziel zu verstehen, mehr als ein fortlaufender Prozess denn als ein starres Artefakt.
  • 22. Eine gute Architektur soll mir helfen ... QAware | 22 ■ ... ohne viel Aufwand zu verstehen, was ein Service tut. ■ ... neue Anforderung in angemessener Zeit umzusetzen. ■ ... mich auf das Wesentliche zu fokussieren. ■ ... technische Entscheidung nicht voreilig treffen zu müssen.
  • 24. Ziele von Clean Architecture QAware | 24 ■ Unabhängigkeit von Frameworks ■ Unabhängigkeit von User-Interfaces ■ Unabhängigkeit von Datenbanken ■ Unabhängigkeit von anderen externen Schnittstellen / Datenquellen ■ Einfache Testbarkeit der Fachlichkeit
  • 25. The center of your application is not the database. Nor is it one or more of the frameworks you may be using. The center of your application are the use cases of your application. - Robert C. Martin - QAware | 25
  • 26. QAware | 26 Quelle: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
  • 32. QAware | 32 Quelle: https://github.com/mattia-battiston/clean-architecture-example
  • 33. Und in der Praxis?
  • 34. QAware | 34 Spring MVC (@RestController), DTOs / Quartz Mapping-Code: DTOs ←→ Domain Objects ------------------------------------------------- Fachlichkeit in @Service Klassen, Domain Entities, Data Provider Interfaces ------------------------------------------------ Mapping-Code: Domain Objects ←→ DB Entitäten JPA/Hibernate, SQL Queries, REST-Templates
  • 37. Was haben wir heute gelernt?
  • 38. Zusammenfassung QAware | 38 ■ Fokus auf UseCases und Domain → Screaming Architecture ■ Klare Trennung von Fachlichkeit und technischen Details → Bessere Verständlichkeit ■ Fachlichkeit separiert in UseCases → Single Responsability > Don’t repeat yourself ■ Datenbank und Frameworks bleiben ein Detail → Architekturentscheidungen später treffen ■ Einfache Testbarkeit → Unit-Tests der Fachlichkeit (z.B. mit In-Memory Data Provider)
  • 39. QAware | 39 Der heilige Gral?
  • 40. It depends! QAware | 40 ■ Keine One-Fits-All Lösung! – Für Services mit wenig Fachlichkeit (CRUD Services) eeventuell zu hoher Mapping Aufwand – Gefühlt viel mehr Code Duplizierung (SRP > DRY) ■ “Build your own naming conventions” ■ Höhere Produktivität! – Klare Struktur & einfachere Verständlichkeit – Änderungen einfacher möglich – Siehe auch “What improves developer productivity at google? code quality” (11/2022) ■ Separation of concern: “The center of your application are the use cases of your application”
  • 41. Green Software Development Community Meetup The challenge of putting software sustainability research into practice Sandro Kreten @ QAware in Munich Jan 19th, 2023 | 18:30
  • 42. qaware.de QAware GmbH Mainz Rheinstraße 4 C 55116 Mainz Tel. +49 6131 21569-0 info@qaware.de twitter.com/qaware linkedin.com/company/qaware-gmbh xing.com/companies/qawaregmbh slideshare.net/qaware github.com/qaware