SlideShare a Scribd company logo
Tactical Design and
Clean Architecture
Ivan Paulovich

Stockholm Domain-Driven Design Meetup

January 30, 2020
https://paulovich.net@ivanpaulovich
Ivan Paulovich
Agile Software Developer, Tech Lead,
20+ GitHub projects about 

Clean Architecture, SOLID, 

DDD and TDD. 

Speaker/Streamer.
@ivanpaulovich
Tactical Design
• Design Patterns and Building Blocks applied within a Bounded Context.

• Used to enrich the Domain Model.

• It is hands-on (Classes, Modules)!

• It is the opposite of Anaemic Model!
@ivanpaulovich
Clean Architecture
• Patterns (not too many).

• Principles (lots of them).

• Practices (TDD?).

• Hands-on (Classes, Modules)
EntitiesEntitiesEntities
Use Cases
Controllers
Gatew
ays
Presenters
D
evices W
eb
UI
DB
External Interfaces
@ivanpaulovich
• Building Blocks
• Aggregate
• Entity
• Value Object
• Domain Service
• Ports and Adapters
• Dependency Inversion
Principle
• Stable Abstractions
Principle.
• Stable Dependencies
Principle.
• SOLID
• TDD
• Use Cases
Tactical Design Clean Architecture
@ivanpaulovich
Domain-Driven Design Patterns
• Bounded Context

• Value Object

• Entity

• Aggregate Root

• Repository

• Use Case

• Entity Factory

• Domain Service

• Application Service
@ivanpaulovich
Virtual Wallet
Customer
Checking
Account
Credit Debit
Openning
Date
Amount
Transaction
Date
Description
Amount
Transaction
Date Description
Name
Personnummer
Mobile Phone
Number
Aggregate
Root
Entity
Value Object
@ivanpaulovich
Entity
1. Highly abstract.

2. Mutable object.

3. Unique identified by an ID

(inside the aggregate).
@ivanpaulovich
Value Object
1. Encapsulate tiny business rules.

2. Immutable object.

3. Unique identified by comparison

of the properties.
@ivanpaulovich
Aggregate Root
1. Owns entities object graph.

2. Ensures the children entities state 

are always consistent.

3. Defines the consistency boundary.

4. Highly Abstract.

5. Highly Stable.
@ivanpaulovich
Aggregate Root
1. Owns entities object graph.

2. Ensures the children entities state 

are always consistent.

3. Defines the consistency boundary.

4. Highly Abstract.

5. Highly Stable.
@ivanpaulovich
Aggregates Together
Aggregate
Entity
Value Object
Value Object
Entity Value Object
Aggregate
• Aggregates know each other only by ID.

• Keep a low coupling between them.
@ivanpaulovich
Repository
1. Provides persistence capabilities to

Aggregate Roots.

2. A Repository for every Entity

is a code smell.
@ivanpaulovich
Domain Service
• Cross-entities functions.

• Without side effects outside
the application memory.
@ivanpaulovich
Architecture The Lost Years by Robert C. Martin
@ivanpaulovich
Architecture UML - Uncle Bob
@ivanpaulovich
The “Software Architecture”
Presentation Layer ASP.NET MVC and Autofac
Business Layer MediatR and AutoMapper
Data Layer Entity Framework and Dapper
Database and Messaging SQL Server and RabbitMQ
IDE and Tools Visual Studio, Resharper and .NET Framework
17 @ivanpaulovich
The “Software Architecture”
Presentation Layer ASP.NET MVC and Autofac
Business Layer MediatR and AutoMapper
Data Layer Entity Framework and Dapper
Database and Messaging SQL Server and RabbitMQ
IDE and Tools Visual Studio, Resharper and .NET Framework
18 @ivanpaulovich
Not a Software
Architecture!
Architecture is About Usage
19 @ivanpaulovich
Clean Architecture
• Use Cases as central organising structure. 

• Follows the Ports and Adapters pattern (Hexagonal Architecture).

• The implementation is guided by tests.

• It is decoupled from technology details.

• Follows lots of Principles (Stability, Abstractness, Dependencies, SOLID).

• Pluggable User Interface.
@ivanpaulovich
Ticket Terminal
Ticket Terminal
Display movies
Request
movie details
Print pre-ordered
tickets
Order tickets
Customer
Movie Catalog
Order System
Credit
Processing
Use Cases
• Use Cases are delivery independent.

• Show the intent of a system.

• Use Cases are algorithms that
interpret the input to generate the
output data.

• Primary and secondary actors.
21 @ivanpaulovich
Business
v
Primary

Actors
@ivanpaulovich22
Ports and Adapters
CloudMessaging
UI
In Memory
Persistence
Tests
In MemoryMessaging
SQL
Secondary

Actors
EntitiesEntities
CleanArchitecture
Entities
Use Cases
Controllers
Gatew
ays
Presenters
D
evices W
eb
UI
DB
External Interfaces
@ivanpaulovich
•Abstractness increases with
stability.

•Modules depend in the
direction of stability.

•Classes that change together
are packaged together.
Entities
Use Cases
Controllers
Presenters
Gateways
Devices UIDB Web
External Interfaces
Abstract,

General,

Stable,

Consistent
Concrete,

Specific, 

Unstable,
Inconsistent
Level
CleanArchitecture
@ivanpaulovich
Use Case
@ivanpaulovich
Use Case Input and Output Messages
1. Immutable.

2. Consistent-ish
@ivanpaulovich
Architecture UML - Uncle Bob
@ivanpaulovich
Microservices?
Are you moving 

from Monolith into Microservices?



Try moving 

from Monolith into Modular-Monolith instead.
@ivanpaulovich
Microservices?
• Low coupling between aggregates.

• Adapters for dependencies.

• Defer extracting an Aggregate.
@ivanpaulovich
Bounded Context
• Another way of saying a Module, Logical Organisation or Component.

• Developed and tested independently.

• Deployment separately is an option/decision.
@ivanpaulovich
• Context Map sets the relationship between contexts.

• Conformist.

• Shared Kernel.

• Customer / Supplier.

• Anti-Corruption Layer.
Bounded Context
Customers Accounts SecurityExchange
@ivanpaulovich
Application
Unit Test
Web
Database
Domain
Primary

Actors
Secondary

Actors
@ivanpaulovich32
Infrastructure
Ports and Adapters
Infra
Services
Controller
Use Case
Domain
Service
Domain
Service
Unit of
Work
Repository
Repository
Core InfrastructureGUI
@ivanpaulovich
@ivanpaulovich
Splitting packages on the software lifetime
Domain
Application
Infrastructure
User Interface
Tests
Tests
Core
Tests
Core
Infrastructure
2nd1st 3rd 4th
WalkthroughanUseCase
Controller
@ivanpaulovich
WalkthroughanUseCase
Use Case
@ivanpaulovich
WalkthroughanUseCase Repository
@ivanpaulovich
WalkthroughanUseCase
Use Case
@ivanpaulovich
WalkthroughanUseCase Domain Service
@ivanpaulovich
WalkthroughanUseCase Repository
@ivanpaulovich
WalkthroughanUseCase Domain Service
@ivanpaulovich
WalkthroughanUseCase
Use Case
@ivanpaulovich
WalkthroughanUseCase
Use Case
@ivanpaulovich
WalkthroughanUseCase
Controller
@ivanpaulovich
Wrapping up Tactical Design
• It enriches the Domain Model.

• It applies Encapsulation, hides details.

• Focus on usage.

• Unambiguity.

• High consistency inside the domain.
45
@ivanpaulovich
Wrapping up Clean Architecture
• Clean Architecture is about usage and the use cases are the central
organizing principle.

• Use cases implementation are guided by tests.

• The User Interface and Persistence are designed to fulfil the core
needs (not the opposite!).

• Defer decisions by implementing the simplest component first.
46
@ivanpaulovich
References
https://cleancoders.com
Clean Code: Component Design
Clean Code: SOLID Principles
Clean Code: Fundamentals
https://github.com/ivanpaulovich/clean-architecture-manga
Robert C Martin - Clean
Architecture and Design
@ivanpaulovich
48
Ask metwo questions!
@ivanpaulovich
Fork me on GitHub

More Related Content

PPTX
Domain Driven Design(DDD) Presentation
Oğuzhan Soykan
 
PPTX
Building rich domain models with ddd and tdd ivan paulovich - betsson
Ivan Paulovich
 
PPTX
Domain Driven Design: Zero to Hero
Fabrício Rissetto
 
PPTX
Domain Driven Design
Ryan Riley
 
PDF
Domain driven design and model driven development
Dmitry Geyzersky
 
PPT
Domain Driven Design (DDD)
Tom Kocjan
 
PPTX
Domain Driven Design 101
Richard Dingwall
 
PDF
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Thomas Pierrain
 
Domain Driven Design(DDD) Presentation
Oğuzhan Soykan
 
Building rich domain models with ddd and tdd ivan paulovich - betsson
Ivan Paulovich
 
Domain Driven Design: Zero to Hero
Fabrício Rissetto
 
Domain Driven Design
Ryan Riley
 
Domain driven design and model driven development
Dmitry Geyzersky
 
Domain Driven Design (DDD)
Tom Kocjan
 
Domain Driven Design 101
Richard Dingwall
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Thomas Pierrain
 

What's hot (20)

PPTX
Applying Domain-Driven Design to craft Rich Domain Models
Alexander van Trijffel
 
PPTX
Introduction to DDD
Eduards Sizovs
 
PDF
Clean pragmatic architecture @ devflix
Victor Rentea
 
PDF
Clean Architecture
Badoo
 
PDF
Clean architecture - Protecting the Domain
Victor Rentea
 
PDF
Domain-driven design - eine Einführung
die.agilen GmbH
 
PDF
Domain Driven Design
Nikolay Vasilev
 
PPTX
Domain Driven Design
Hannah Farrugia
 
PPTX
Brownfield Domain Driven Design
Nicolò Pignatelli
 
PDF
Real Life Clean Architecture
Mattia Battiston
 
PPTX
Clean architecture
andbed
 
PPTX
Micro-frontend
Miguel Angel Teheran Garcia
 
PDF
D2 domain driven-design
Arnaud Bouchez
 
PDF
Introducing Clean Architecture
Roc Boronat
 
PPTX
Domain Driven Design
Nader Albert
 
PPSX
Domain Driven Design
Araf Karsh Hamid
 
PDF
DevDay2017 ESGI Essential DDD
Gregory Boissinot
 
PDF
Asynchronous API in Java8, how to use CompletableFuture
José Paumard
 
PDF
Clean architecture
Lieven Doclo
 
PPTX
Implementing DDD with C#
Pascal Laurin
 
Applying Domain-Driven Design to craft Rich Domain Models
Alexander van Trijffel
 
Introduction to DDD
Eduards Sizovs
 
Clean pragmatic architecture @ devflix
Victor Rentea
 
Clean Architecture
Badoo
 
Clean architecture - Protecting the Domain
Victor Rentea
 
Domain-driven design - eine Einführung
die.agilen GmbH
 
Domain Driven Design
Nikolay Vasilev
 
Domain Driven Design
Hannah Farrugia
 
Brownfield Domain Driven Design
Nicolò Pignatelli
 
Real Life Clean Architecture
Mattia Battiston
 
Clean architecture
andbed
 
D2 domain driven-design
Arnaud Bouchez
 
Introducing Clean Architecture
Roc Boronat
 
Domain Driven Design
Nader Albert
 
Domain Driven Design
Araf Karsh Hamid
 
DevDay2017 ESGI Essential DDD
Gregory Boissinot
 
Asynchronous API in Java8, how to use CompletableFuture
José Paumard
 
Clean architecture
Lieven Doclo
 
Implementing DDD with C#
Pascal Laurin
 
Ad

Similar to DDD Tactical Design with Clean Architecture - Ivan Paulovich (20)

PPTX
Clean architecture
.NET Crowd
 
PDF
Clean Architecture Essentials - Stockholm Software Craftsmanship
Ivan Paulovich
 
PDF
Agile Gurugram 30-31Aug 2024 | Tactical Architecture: Where the Rubber Meets ...
AgileNetwork
 
PPTX
Clean architecture
Travis Frisinger
 
PDF
Clean Architecture Essentials @ivanpaulovich
Ivan Paulovich
 
PPTX
The Clean Architecture
Dmytro Turskyi
 
PDF
Clean architecture with asp.net core
Sam Nasr, MCSA, MVP
 
PDF
Clean Architecture By Jason Taylor
maa77
 
PDF
Implementing Clean Architecture
Florin Coros
 
PDF
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp
 
PDF
Agile Architecture Agile Dev Practices 2013 Keynote
Adam Boczek
 
PPTX
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
NETFest
 
ODP
Software Patterns
Sudarsun Santhiappan
 
PDF
Smart Client Development
Tamir Khason
 
PDF
Explicit architecture
Herberto Graça
 
PDF
Software design with Domain-driven design
Allan Mangune
 
PPTX
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Steven Smith
 
PPTX
Gof design patterns
Srikanth R Vaka
 
PPT
Java Enterprise Architecture D68136GC10_les02.ppt
YulinLiu27
 
PPT
Software_Archi-1.ppt
FaizaZulkifal
 
Clean architecture
.NET Crowd
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Ivan Paulovich
 
Agile Gurugram 30-31Aug 2024 | Tactical Architecture: Where the Rubber Meets ...
AgileNetwork
 
Clean architecture
Travis Frisinger
 
Clean Architecture Essentials @ivanpaulovich
Ivan Paulovich
 
The Clean Architecture
Dmytro Turskyi
 
Clean architecture with asp.net core
Sam Nasr, MCSA, MVP
 
Clean Architecture By Jason Taylor
maa77
 
Implementing Clean Architecture
Florin Coros
 
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp
 
Agile Architecture Agile Dev Practices 2013 Keynote
Adam Boczek
 
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
NETFest
 
Software Patterns
Sudarsun Santhiappan
 
Smart Client Development
Tamir Khason
 
Explicit architecture
Herberto Graça
 
Software design with Domain-driven design
Allan Mangune
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Steven Smith
 
Gof design patterns
Srikanth R Vaka
 
Java Enterprise Architecture D68136GC10_les02.ppt
YulinLiu27
 
Software_Archi-1.ppt
FaizaZulkifal
 
Ad

More from Ivan Paulovich (17)

PPTX
Moving to Microservices
Ivan Paulovich
 
PPTX
Produzindo e consumindo um stream de eventos
Ivan Paulovich
 
PDF
Como uma aplicação baseada em fluxo de dados pode ampliar a segurança em crec...
Ivan Paulovich
 
PDF
Como uma aplicação baseada em fluxo de dados pode ampliar a segurança em creches
Ivan Paulovich
 
PDF
Aggregates com Event Sourcing
Ivan Paulovich
 
PPTX
Estudo do eShopOnContainers
Ivan Paulovich
 
PPTX
Introdução ao Domain-Driven-Design (DDD)
Ivan Paulovich
 
PPTX
Princípios SOLID de OO usando .NET
Ivan Paulovich
 
PPTX
Utilize o vso e publique imagens docker Global Azure Bootcamp - BH
Ivan Paulovich
 
PPTX
Windows Azure Mobile Services InfoTech 2014
Ivan Paulovich
 
PPTX
Mercado de ti e suas oportunidades
Ivan Paulovich
 
PPTX
Construindo Apps Com SignalR
Ivan Paulovich
 
PPTX
Construindo apps de tempo real com SignalR
Ivan Paulovich
 
PPTX
Construindo Apps com ASP.NET SignalR
Ivan Paulovich
 
PPTX
Levando sua aplicação para a nuvem
Ivan Paulovich
 
PPTX
Conhecendo os recursos do ASP.NET Web API
Ivan Paulovich
 
PPTX
Criando aplicativos para Windows 8 usando apenas HTML5 e Javascript
Ivan Paulovich
 
Moving to Microservices
Ivan Paulovich
 
Produzindo e consumindo um stream de eventos
Ivan Paulovich
 
Como uma aplicação baseada em fluxo de dados pode ampliar a segurança em crec...
Ivan Paulovich
 
Como uma aplicação baseada em fluxo de dados pode ampliar a segurança em creches
Ivan Paulovich
 
Aggregates com Event Sourcing
Ivan Paulovich
 
Estudo do eShopOnContainers
Ivan Paulovich
 
Introdução ao Domain-Driven-Design (DDD)
Ivan Paulovich
 
Princípios SOLID de OO usando .NET
Ivan Paulovich
 
Utilize o vso e publique imagens docker Global Azure Bootcamp - BH
Ivan Paulovich
 
Windows Azure Mobile Services InfoTech 2014
Ivan Paulovich
 
Mercado de ti e suas oportunidades
Ivan Paulovich
 
Construindo Apps Com SignalR
Ivan Paulovich
 
Construindo apps de tempo real com SignalR
Ivan Paulovich
 
Construindo Apps com ASP.NET SignalR
Ivan Paulovich
 
Levando sua aplicação para a nuvem
Ivan Paulovich
 
Conhecendo os recursos do ASP.NET Web API
Ivan Paulovich
 
Criando aplicativos para Windows 8 usando apenas HTML5 e Javascript
Ivan Paulovich
 

Recently uploaded (20)

PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PPTX
quantum computing transition from classical mechanics.pptx
gvlbcy
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PPT
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
quantum computing transition from classical mechanics.pptx
gvlbcy
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 

DDD Tactical Design with Clean Architecture - Ivan Paulovich