SlideShare a Scribd company logo
Domain Driven Design
&
Hexagonal Architecture
Handling Complex Business Logic
Can Pekdemir
About me
Expert Software Engineer @iyzico
Dokuz Eylul University – Computer Science – 2010
Worked as consultancy in various domains like finance, e-commerce, telecom
Speaking at meetups rarely
The term
Domain Driven Design:
Tackling Complexity in the Heart of Software,
Eric Evans, 2003
Our Biggest Problems
Growing Complexity
Time to Market
General problems in sw development
Thinking software development as a cost center rather than a profit center
Heavy usage of the latest sexy framework all cool kids talk about
Poor collaboration with the business
Not giving real emphasis to naming things
Wrong abstractions and generalizing solutions unnecessarily by thinking
about 5 years later
Domain Driven Design
An approach for solving complex business problems
A mindset of developing business not only software
Helps team organization, enterprise architecture, code design
Cope with technology challenges ( e.g. Enterprise frameworks, NoSql,
Microservices)
Big ball of mud
Exploring the domain with
collaboration
Hands-on Modelers
People who write the code should feel responsible for the model.
A modeler should not be separated from implementation.
Ubiquitous Language
One team, one language
No need for translation
Use in both communication and in the code
Bounded Context
A semantic contextual boundary
Divide large system into autonomous contexts
Be explicit about the context responsibilities
Set boundaries and relationships with each other
Care about team organization, code bases, database schemas
Make sense of Bounded Contexts for
your company
Strategic Design with Bounded Context
Started as a monolithic application
More teams operated on the same application
Ownership began to blur
Shared resources were making it difficult to scale-out
“the traditional model is that you take your software to the wall that
separates development and operations, and throw it over and then forget
about it. Not at Amazon. You build it, you run it.”
Werner Vogels, CTO, Amazon, 2006
http://queue.acm.org/detail.cfm?id=1142065
Real Numbers
Over 6000 employees
In 400 cities and 70 countries
From 200 engineers to 2000 Engineers only in a year and half
8000 git repositories
Over 1000 microservices
https://www.youtube.com/watch?v=kb-m2fasdDY
What I Wish I Had Known Before Scaling Uber to 1000 Services - Matt
Ranney
“Scaling the traffic is not the issue. Scaling the team and the product feature
release rate is the primary driver.”
Context Mapping
• Strategic domain driven design
• Very useful tool to understand overall architecture and relationships of the
system.
Relations of Bounded Contexts
Anti Corruption Layers
Protect your own domain from the dependent contexts
Translate unrelated namings into your own domain
Protect yourself from others’ failures with timeouts and circuit breakers
Integrate Bounded Contexts with
Restful API
See your API from the consumer’s eyes
Do not reflect your entities to restful resources directly
Use consumer driven contract libraries ( e.g. PACT, Spring Cloud Contracts )
Integrate Bounded Contexts with
Messaging
Design your domain events regarding your business logic
Use at-least-once delivery messaging mechanism
Be careful about your receivers to idempotent
Aggregates
Compose entities and value objects and mark one entity as root
Apply consistency boundaries within aggregates
Modify and commit only one aggregate instance in one transaction
Hint for microservices
Aggregates (2)
Aggregate Design Rules
Do not let your business logic inside an aggregate leak
Design small aggregates
Reference by identity only
Update other aggregates by eventual consistency ( optional for scalability )
Domain Events
A record of some business-significant occurence in bounded context
Append-only event store mechanisms can be implemented
Organize your Code
Baklava Code
Code with too many layers
Hexagonal Architecture
Technology free Domain Model
“Allow an application to equally be driven by users, programs, automated test
or batch scripts, and to be developed and tested in isolation from its eventual
run-time devices and databases.” Alistair Cockburn – 2005
Decide on what is inside and outside
Benefits
Abstracts your business code from technical frameworks
Helps you to change your architectural decisions easily
Helps doing BDD and TDD
Packaging
Styles
Code time
References
Books
- Domain Driven Design: Tackling Complexity in the Heart of Software
- Domain Driven Design Distilled
- Implementing Domain Driven Design
- Building Microservices
Links
- http://www.codingthearchitecture.com/2016/04/25/layers_hexagons_features_and_components.html
- http://alistair.cockburn.us/Hexagonal+architecture
- https://www.johndcook.com/blog/2009/07/27/baklav-code/

More Related Content

What's hot

Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
Nguyen Tung
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
Amazon Web Services
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh Architectures
Mirantis
 
Microservices for Application Modernisation
Microservices for Application ModernisationMicroservices for Application Modernisation
Microservices for Application Modernisation
Ajay Kumar Uppal
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
Araf Karsh Hamid
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
Paul Mooney
 
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
Chad Lawler
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
WSO2
 
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
SOAT
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Roger van de Kimmenade
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with Kafka
Kasun Indrasiri
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
Eberhard Wolff
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
Shadrach Jabonir
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
Araf Karsh Hamid
 
API Governance in the Enterprise
API Governance in the EnterpriseAPI Governance in the Enterprise
API Governance in the Enterprise
Apigee | Google Cloud
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
Faren faren
 
Introducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring StatemachineIntroducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring Statemachine
VMware Tanzu
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
Anil Allewar
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
Amazon Web Services
 

What's hot (20)

Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh Architectures
 
Microservices for Application Modernisation
Microservices for Application ModernisationMicroservices for Application Modernisation
Microservices for Application Modernisation
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
Integrated Cloud Framework: Security, Governance, Compliance, Content Applica...
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
 
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with Kafka
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
 
API Governance in the Enterprise
API Governance in the EnterpriseAPI Governance in the Enterprise
API Governance in the Enterprise
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Introducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring StatemachineIntroducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring Statemachine
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 

Similar to Domain Driven Design & Hexagonal Architecture

MOND Semantics Integration
MOND Semantics IntegrationMOND Semantics Integration
MOND Semantics Integration
Sales Emea
 
Building a Hybrid Cloud The Real Deal
Building a Hybrid Cloud The Real DealBuilding a Hybrid Cloud The Real Deal
Building a Hybrid Cloud The Real Deal
RightScale
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
GlobalLogic Ukraine
 
First Steps in Native Cloud Application
First Steps in Native Cloud ApplicationFirst Steps in Native Cloud Application
First Steps in Native Cloud Application
Mauricio "Maltron" Leal
 
Wicsa2011 cloud tutorial
Wicsa2011 cloud tutorialWicsa2011 cloud tutorial
Wicsa2011 cloud tutorialAnna Liu
 
Scanning To Cloud Presentation
Scanning To Cloud PresentationScanning To Cloud Presentation
Scanning To Cloud Presentation
guest3a3ab
 
You Name Here1. Explain the difference between hardware and so.docx
You Name Here1. Explain the difference between hardware and so.docxYou Name Here1. Explain the difference between hardware and so.docx
You Name Here1. Explain the difference between hardware and so.docx
jeffevans62972
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
wojtek_s
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
Alessandro Giorgetti
 
GOTO Berlin 2016
GOTO Berlin 2016GOTO Berlin 2016
GOTO Berlin 2016
Christian Deger
 
The Cloud Computing Strategy Of Xyz Manufacturing
The Cloud Computing Strategy Of Xyz ManufacturingThe Cloud Computing Strategy Of Xyz Manufacturing
The Cloud Computing Strategy Of Xyz Manufacturing
Mindi Schneider
 
Cloud computing
Cloud computingCloud computing
Cloud computing
Richard Claassens CIPPE
 
The IBM Cloud
The IBM CloudThe IBM Cloud
The IBM Cloud
Intel Corporation
 
Cloud Computing and Microsoft
Cloud Computing and MicrosoftCloud Computing and Microsoft
Cloud Computing and Microsoft
John Bristowe
 
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
Kai Wähner
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
Chase Aucoin
 
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
Lucas Jellema
 
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
Amazon Web Services
 
Microservices in the cloud at AutoScout24
Microservices in the cloud at AutoScout24Microservices in the cloud at AutoScout24
Microservices in the cloud at AutoScout24
Christian Deger
 
Microservices Architecture for e-Commerce
Microservices Architecture for e-CommerceMicroservices Architecture for e-Commerce
Microservices Architecture for e-Commerce
Divante
 

Similar to Domain Driven Design & Hexagonal Architecture (20)

MOND Semantics Integration
MOND Semantics IntegrationMOND Semantics Integration
MOND Semantics Integration
 
Building a Hybrid Cloud The Real Deal
Building a Hybrid Cloud The Real DealBuilding a Hybrid Cloud The Real Deal
Building a Hybrid Cloud The Real Deal
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
First Steps in Native Cloud Application
First Steps in Native Cloud ApplicationFirst Steps in Native Cloud Application
First Steps in Native Cloud Application
 
Wicsa2011 cloud tutorial
Wicsa2011 cloud tutorialWicsa2011 cloud tutorial
Wicsa2011 cloud tutorial
 
Scanning To Cloud Presentation
Scanning To Cloud PresentationScanning To Cloud Presentation
Scanning To Cloud Presentation
 
You Name Here1. Explain the difference between hardware and so.docx
You Name Here1. Explain the difference between hardware and so.docxYou Name Here1. Explain the difference between hardware and so.docx
You Name Here1. Explain the difference between hardware and so.docx
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
GOTO Berlin 2016
GOTO Berlin 2016GOTO Berlin 2016
GOTO Berlin 2016
 
The Cloud Computing Strategy Of Xyz Manufacturing
The Cloud Computing Strategy Of Xyz ManufacturingThe Cloud Computing Strategy Of Xyz Manufacturing
The Cloud Computing Strategy Of Xyz Manufacturing
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
The IBM Cloud
The IBM CloudThe IBM Cloud
The IBM Cloud
 
Cloud Computing and Microsoft
Cloud Computing and MicrosoftCloud Computing and Microsoft
Cloud Computing and Microsoft
 
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
 
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
Forms 2 Future - the ongoing journey into the future for Oracle based organiz...
 
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
AWS re:Invent 2016: [JK REPEAT] The Enterprise Fast Lane - What Your Competit...
 
Microservices in the cloud at AutoScout24
Microservices in the cloud at AutoScout24Microservices in the cloud at AutoScout24
Microservices in the cloud at AutoScout24
 
Microservices Architecture for e-Commerce
Microservices Architecture for e-CommerceMicroservices Architecture for e-Commerce
Microservices Architecture for e-Commerce
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

Domain Driven Design & Hexagonal Architecture

  • 1. Domain Driven Design & Hexagonal Architecture Handling Complex Business Logic Can Pekdemir
  • 2. About me Expert Software Engineer @iyzico Dokuz Eylul University – Computer Science – 2010 Worked as consultancy in various domains like finance, e-commerce, telecom Speaking at meetups rarely
  • 3. The term Domain Driven Design: Tackling Complexity in the Heart of Software, Eric Evans, 2003
  • 4. Our Biggest Problems Growing Complexity Time to Market
  • 5. General problems in sw development Thinking software development as a cost center rather than a profit center Heavy usage of the latest sexy framework all cool kids talk about Poor collaboration with the business Not giving real emphasis to naming things Wrong abstractions and generalizing solutions unnecessarily by thinking about 5 years later
  • 6. Domain Driven Design An approach for solving complex business problems A mindset of developing business not only software Helps team organization, enterprise architecture, code design Cope with technology challenges ( e.g. Enterprise frameworks, NoSql, Microservices)
  • 8. Exploring the domain with collaboration
  • 9. Hands-on Modelers People who write the code should feel responsible for the model. A modeler should not be separated from implementation.
  • 10. Ubiquitous Language One team, one language No need for translation Use in both communication and in the code
  • 11. Bounded Context A semantic contextual boundary Divide large system into autonomous contexts Be explicit about the context responsibilities Set boundaries and relationships with each other Care about team organization, code bases, database schemas
  • 12. Make sense of Bounded Contexts for your company
  • 13. Strategic Design with Bounded Context Started as a monolithic application More teams operated on the same application Ownership began to blur Shared resources were making it difficult to scale-out “the traditional model is that you take your software to the wall that separates development and operations, and throw it over and then forget about it. Not at Amazon. You build it, you run it.” Werner Vogels, CTO, Amazon, 2006 http://queue.acm.org/detail.cfm?id=1142065
  • 14. Real Numbers Over 6000 employees In 400 cities and 70 countries From 200 engineers to 2000 Engineers only in a year and half 8000 git repositories Over 1000 microservices https://www.youtube.com/watch?v=kb-m2fasdDY What I Wish I Had Known Before Scaling Uber to 1000 Services - Matt Ranney “Scaling the traffic is not the issue. Scaling the team and the product feature release rate is the primary driver.”
  • 15. Context Mapping • Strategic domain driven design • Very useful tool to understand overall architecture and relationships of the system.
  • 17. Anti Corruption Layers Protect your own domain from the dependent contexts Translate unrelated namings into your own domain Protect yourself from others’ failures with timeouts and circuit breakers
  • 18. Integrate Bounded Contexts with Restful API See your API from the consumer’s eyes Do not reflect your entities to restful resources directly Use consumer driven contract libraries ( e.g. PACT, Spring Cloud Contracts )
  • 19. Integrate Bounded Contexts with Messaging Design your domain events regarding your business logic Use at-least-once delivery messaging mechanism Be careful about your receivers to idempotent
  • 20. Aggregates Compose entities and value objects and mark one entity as root Apply consistency boundaries within aggregates Modify and commit only one aggregate instance in one transaction Hint for microservices
  • 22. Aggregate Design Rules Do not let your business logic inside an aggregate leak Design small aggregates Reference by identity only Update other aggregates by eventual consistency ( optional for scalability )
  • 23. Domain Events A record of some business-significant occurence in bounded context Append-only event store mechanisms can be implemented
  • 24. Organize your Code Baklava Code Code with too many layers
  • 25. Hexagonal Architecture Technology free Domain Model “Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.” Alistair Cockburn – 2005 Decide on what is inside and outside
  • 26. Benefits Abstracts your business code from technical frameworks Helps you to change your architectural decisions easily Helps doing BDD and TDD
  • 29. References Books - Domain Driven Design: Tackling Complexity in the Heart of Software - Domain Driven Design Distilled - Implementing Domain Driven Design - Building Microservices Links - http://www.codingthearchitecture.com/2016/04/25/layers_hexagons_features_and_components.html - http://alistair.cockburn.us/Hexagonal+architecture - https://www.johndcook.com/blog/2009/07/27/baklav-code/