SlideShare a Scribd company logo
1 of 41
Download to read offline
ADD SOME DDDTO YOURASP.NET MVC, OK? 
STEVE SMITH 
CTO, FALAFEL SOFTWARE 
@ARDALIS| STEVE.SMITH@FALAFEL.COM
WHAT IS DOMAIN-DRIVEN DESIGN (DDD)?
Communication 
•Ubiquitous Language 
•Domain Expert Interaction 
Modeling 
•Core Domain 
•Generic Subdomains 
•Bounded Context 
•Context Map 
•Shared Kernel 
•Anti-Corruption Layer 
Implementation 
•Model-Driven Design 
•Layered Architecture 
•Entities 
•Value Objects 
•Services 
•Factories 
•Aggregates 
•Repositories 
•Domain Events
DDD IS BIG 
“THE MORE YOU KNOW, THE MORE YOU REALIZE YOU KNOW NOTHING.” 
SOCRATES
DDD FUNDAMENTALS COURSE 
•OVER 4 HOURS OF CONTENT (DEMOS USING MVC + SIGNALR) 
•HTTP://BIT.LY/PS-DDD
DDD BENEFITS 
•FLEXIBILITY 
•SOFTWARE MODELS CUSTOMER’S UNDERSTANDING OF PROBLEM 
•BREAKS COMPLEXITY INTO MANAGEABLE PIECES 
•Well-organized; easily tested 
•Business logic lives in one place
DDD DRAWBACKS 
•TIME AND EFFORT 
•LEARNING CURVE 
•OVERKILL WITHOUT COMPLEXITY 
•“ANEMIC” DOMAIN MODEL PROBLEM
COMMUNICATION 
“AS SOFTWARE DEVELOPERS, WE FAIL IN TWO WAYS: WE BUILD THE THING WRONG, OR WE BUILD THE WRONG THING.” 
ME
UBIQUITOUS LANGUAGE 
http://upload.wikimedia.org/wikipedia/commons/2/23/Rosetta_Stone.JPG
LANGUAGE 
“A PROJECT FACES SERIOUS PROBLEMS WHEN ITS LANGUAGE IS FRACTURED.” 
ERIC EVANS
UBIQUITOUS LANGUAGE 
•UBIQUITOUS–ADJECTIVE. PRESENT, APPEARING, OR FOUND EVERYWHERE. 
•SYNONYMS: PERVASIVE, UNIVERSAL 
•USED WITHIN A GIVEN BOUNDED CONTEXT 
•USED IN CODE, DESIGN DOCUMENTS, AND CONVERSATIONS 
--EVERYWHERE
DOMAINTERMS 
Domain Experts 
Problem Domain 
Core Domain 
Sub-Domains
BOUNDED CONTEXTS 
•PROVIDE SEPARATION OF CONCERNS 
•LIMIT COMPLEXITY 
•SHOULD BE CLEARLY BOUNDEDAND SEPARATE
Appointment Scheduling 
Billing
Appointment Scheduling 
Billing 
Anti- 
Corruption 
Layer
MODEL DRIVEN DESIGN 
NOTDATA-DRIVEN
LAYERED ARCHITECTURE 
•PORTS AND ADAPTERS 
•HEXAGONAL 
•ONION
ORGANIZING IN A SOLUTION
ENTITIES 
“MANY OBJECTS ARE NOT FUNDAMENTALLY DEFINED BY THEIR ATTRIBUTES, BUT RATHER BY A THREAD OF CONTINUITY AND IDENTITY.” 
ERIC EVANS
CHANGING ATTRIBUTES DOESN’T CHANGE WHICH ONE WE’RE TALKING ABOUT 
ID:1 
•Name: Steve Smith 
•Twitter: @ardalis 
•Favorite Color: Blue 
ID: 1 
•Name: StevenSmith 
•Twitter: @ardalis 
•Favorite Color: Blue 
ID: 1 
•Name: Steven Smith 
•Twitter: @ardalis 
•Favorite Color: Orange
VALUE OBJECTS 
•DEFINED BY THEIR ATTRIBUTES 
•IMMUTABLE 
•SHOULD HAVE NO SIDE EFFECTS 
•EXAMPLES: STRINGS, ADDRESSES, CURRENCY
Immutable!
DOMAIN SERVICES 
•NOT A NATURAL PART OF AN ENTITY OR VALUE OBJECT 
•INTERFACEDEFINED IN TERMS OF OTHER MODEL ELEMENTS 
•SHOULD BE STATELESS(BUT MAY HAVE SIDE EFFECTS)
SERVICES IN DIFFERENT LAYERS 
UI Layer 
& Application Layer 
Infrastructure 
Domain 
(“Application Core”) 
Message Sending 
Message Processing 
XML Parsing 
UI Services 
Transfer Between Accounts 
Process Order 
Send Email 
Log to a File
DOMAIN EVENTS 
“USE A DOMAIN EVENT TO CAPTURE AN OCCURRENCE OF SOMETHING THAT HAPPENED IN THE DOMAIN.” 
VAUGHN VERNON 
IMPLEMENTING DOMAIN-DRIVEN DESIGN
DOMAIN EVENT TIPS 
•CONSIDER FOR CASES OF “WHENTHIS HAPPENS, THEN…” 
•OR “NOTIFY SOMEONE WHEN…” 
•DOMAIN EVENTS REPRESENT THE PAST 
•THEY ALREADY HAPPENED 
•THUS, THEY SHOULD BE IMMUTABLE
EXAMPLES OF DOMAIN EVENTS 
UserAuthenticated 
Appointment 
Confirmed 
PaymentReceived 
$¢£¥
DESIGNING DOMAIN EVENTS 
•EACH EVENT IS A CLASS 
•USE A COMMON INTERFACE (E.G. IDOMAINEVENT) 
•CAPTURE WHEN THE EVENT TOOK PLACE 
•INCLUDE DETAILS 
•WHAT WOULD YOU NEED TO KNOW TO TRIGGER THIS EVENT AGAIN? 
•INCLUDE IDENTITIESOF ANY ENTITIESINVOLVED 
•INITIALIZE ALL STATE IN CONSTRUCTOR 
•NO BEHAVIOR OR SIDE EFFECTS –JUST STATE
MORE DDD TOPICS 
•AGGREGATES 
•REPOSITORIES 
•FACTORIES 
Learn More: 
DDD Fundamentals on Pluralsight 
Eric Evans’ DDD Book 
Email: steve.smith@falafel.com
DOMAIN MODELS AND MVC MODELS 
•UI INTERACTS DIRECTLY WITH DOMAIN MODEL 
•ENTITIES, VALUE OBJECTS 
•INTERFACES, SERVICES 
•VIEWS MAY WORK WITH CUSTOM VIEWMODELS 
•CLIENT (HTML/JS) CODE MAY USE ANOTHER (CLIENT-SIDE) VIEWMODELAS WELL
CONTROLLERS 
•KEEP AS SMALL AS POSSIBLE 
•ELIMINATE BUSINESS LOGIC 
•INJECT ALL DEPENDENCIES 
•HTTP://DEVIQ.COM/EXPLICIT-DEPENDENCIES-PRINCIPLE
VIEWS 
•NO LOGIC UNLESS ENCAPSULATED IN TESTED HELPERS 
•NO BUSINESS LOGIC IF IT CAN INSTEAD BE MODELED IN THE DOMAIN
SIGNALR 
•AWESOME ADDITION TO ASP.NET 
•GREAT FOR NOTIFICATIONS TO MULTIPLE USERS 
•TIES IN EASILY WITH DOMAIN EVENTS 
•EVENT HANDLERS CAN BE ADDED TO UI PROJECT
SOLUTION STRUCTURE 
•CORE 
•INTERFACES 
•MODEL (ENTITIES, VALUE OBJECTS) 
•DOMAIN SERVICES 
•INFRASTRUCTURE 
•DBCONTEXT 
•FILE ACCESS 
•SYSTEM CLOCK ACCESS 
•EMAIL SERVICES 
•WEB 
•MVC PROJECT 
•NO DIRECT USE OF INFRASTRUCTURE
DEMO 
PUTTING DDD INTO ASP.NET MVC
Learn More:

More Related Content

What's hot

CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureThomas Jaskula
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRSthinkddd
 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in phpLeonardo Proietti
 
Refactoring to SOLID Code
Refactoring to SOLID CodeRefactoring to SOLID Code
Refactoring to SOLID CodeAdil Mughal
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software designMatthias Noback
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity FrameworkLynn Langit
 
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHPImplementing DDD Concepts in PHP
Implementing DDD Concepts in PHPSteve Rhoades
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blogbarryosull
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Enea Gabriel
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Anna Shymchenko
 
Leveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectLeveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectThomas Jaskula
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#Thomas Jaskula
 
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...Frank van der Linden
 
20160609 nike techtalks reactive applications tools of the trade
20160609 nike techtalks reactive applications   tools of the trade20160609 nike techtalks reactive applications   tools of the trade
20160609 nike techtalks reactive applications tools of the tradeshinolajla
 
Polaris presentation ioc - code conference
Polaris presentation   ioc - code conferencePolaris presentation   ioc - code conference
Polaris presentation ioc - code conferenceSteven Contos
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
Design for scale
Design for scaleDesign for scale
Design for scaleDoug Lampe
 
Spring 1 day program
Spring 1 day programSpring 1 day program
Spring 1 day programMohit Kanwar
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkMohit Kanwar
 

What's hot (20)

CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRS
 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in php
 
Refactoring to SOLID Code
Refactoring to SOLID CodeRefactoring to SOLID Code
Refactoring to SOLID Code
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software design
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity Framework
 
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHPImplementing DDD Concepts in PHP
Implementing DDD Concepts in PHP
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blog
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
 
Leveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectLeveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup project
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#
 
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
 
20160609 nike techtalks reactive applications tools of the trade
20160609 nike techtalks reactive applications   tools of the trade20160609 nike techtalks reactive applications   tools of the trade
20160609 nike techtalks reactive applications tools of the trade
 
Polaris presentation ioc - code conference
Polaris presentation   ioc - code conferencePolaris presentation   ioc - code conference
Polaris presentation ioc - code conference
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Design for scale
Design for scaleDesign for scale
Design for scale
 
Spring 1 day program
Spring 1 day programSpring 1 day program
Spring 1 day program
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 

Viewers also liked

Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCApplying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCMohamed Meligy
 
Application Architecture for Enterprise Win Store Apps with DDD Pattern
Application Architecture for Enterprise Win Store Apps with DDD PatternApplication Architecture for Enterprise Win Store Apps with DDD Pattern
Application Architecture for Enterprise Win Store Apps with DDD PatternAtsushi Kambara
 
Strategic design using ddd
Strategic design using dddStrategic design using ddd
Strategic design using dddPaul Rayner
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Scott Wlaschin
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
SOLID - Teoria e Prática
SOLID - Teoria e PráticaSOLID - Teoria e Prática
SOLID - Teoria e PráticaEduardo Pires
 
Loose and fluffy_ddd_intro
Loose and fluffy_ddd_introLoose and fluffy_ddd_intro
Loose and fluffy_ddd_introcch-robo
 

Viewers also liked (8)

DDD eXchange
DDD eXchangeDDD eXchange
DDD eXchange
 
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCApplying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
 
Application Architecture for Enterprise Win Store Apps with DDD Pattern
Application Architecture for Enterprise Win Store Apps with DDD PatternApplication Architecture for Enterprise Win Store Apps with DDD Pattern
Application Architecture for Enterprise Win Store Apps with DDD Pattern
 
Strategic design using ddd
Strategic design using dddStrategic design using ddd
Strategic design using ddd
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
SOLID - Teoria e Prática
SOLID - Teoria e PráticaSOLID - Teoria e Prática
SOLID - Teoria e Prática
 
Loose and fluffy_ddd_intro
Loose and fluffy_ddd_introLoose and fluffy_ddd_intro
Loose and fluffy_ddd_intro
 

Similar to Add Some DDD to Your ASP.NET MVC, OK?

DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014FalafelSoftware
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseKevin Mas Ruiz
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A PrecisDavid Simons
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use itMark Windholtz
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPChris Renner
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainNeo4j
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017Jonathan Wylliem
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsMark Windholtz
 
Webinar: Fighting Fraud with Graph Databases
Webinar: Fighting Fraud with Graph DatabasesWebinar: Fighting Fraud with Graph Databases
Webinar: Fighting Fraud with Graph DatabasesDataStax
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsAlexander van Trijffel
 
Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Mark Windholtz
 
Why We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsWhy We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsRebecca Wirfs-Brock
 
Best practices When Migrating to Office 365
Best practices When Migrating to Office 365Best practices When Migrating to Office 365
Best practices When Migrating to Office 365Perficient, Inc.
 
Design Considerations When Building Cross Platform Mobile Applications
 Design Considerations When Building Cross Platform Mobile Applications Design Considerations When Building Cross Platform Mobile Applications
Design Considerations When Building Cross Platform Mobile ApplicationsSuperConnect
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Can Pekdemir
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationAndrew Siemer
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training IntroductionMax De Marzi
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock Steve Barbour
 

Similar to Add Some DDD to Your ASP.NET MVC, OK? (20)

DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A Precis
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHP
 
My feedback on ddd europe
My feedback on ddd europeMy feedback on ddd europe
My feedback on ddd europe
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & Bahrain
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic Patterns
 
Webinar: Fighting Fraud with Graph Databases
Webinar: Fighting Fraud with Graph DatabasesWebinar: Fighting Fraud with Graph Databases
Webinar: Fighting Fraud with Graph Databases
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain Models
 
Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15
 
Why We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsWhy We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile Projects
 
Best practices When Migrating to Office 365
Best practices When Migrating to Office 365Best practices When Migrating to Office 365
Best practices When Migrating to Office 365
 
Design Considerations When Building Cross Platform Mobile Applications
 Design Considerations When Building Cross Platform Mobile Applications Design Considerations When Building Cross Platform Mobile Applications
Design Considerations When Building Cross Platform Mobile Applications
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training Introduction
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 

More from Steven Smith

Clean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisClean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisSteven Smith
 
Finding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsFinding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsSteven Smith
 
Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Steven Smith
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Steven Smith
 
Introducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashIntroducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashSteven Smith
 
Most Useful Design Patterns
Most Useful Design PatternsMost Useful Design Patterns
Most Useful Design PatternsSteven Smith
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing SoftwareSteven Smith
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Steven Smith
 
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Steven Smith
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Steven Smith
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5Steven Smith
 
My Iraq Experience
My Iraq ExperienceMy Iraq Experience
My Iraq ExperienceSteven Smith
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing SoftwareSteven Smith
 
Refactoring with SOLID Principles (FalafelCon 2013)
Refactoring with SOLID Principles (FalafelCon 2013)Refactoring with SOLID Principles (FalafelCon 2013)
Refactoring with SOLID Principles (FalafelCon 2013)Steven Smith
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Steven Smith
 
Refactoring with SOLID - Telerik India DevCon 2013
Refactoring with SOLID - Telerik India DevCon 2013Refactoring with SOLID - Telerik India DevCon 2013
Refactoring with SOLID - Telerik India DevCon 2013Steven Smith
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesSteven Smith
 
Common asp.net design patterns aspconf2012
Common asp.net design patterns aspconf2012Common asp.net design patterns aspconf2012
Common asp.net design patterns aspconf2012Steven Smith
 
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Steven Smith
 

More from Steven Smith (20)

Clean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisClean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by Ardalis
 
Finding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsFinding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design Patterns
 
Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
 
Introducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashIntroducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemash
 
Most Useful Design Patterns
Most Useful Design PatternsMost Useful Design Patterns
Most Useful Design Patterns
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing Software
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5
 
Domain events
Domain eventsDomain events
Domain events
 
My Iraq Experience
My Iraq ExperienceMy Iraq Experience
My Iraq Experience
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing Software
 
Refactoring with SOLID Principles (FalafelCon 2013)
Refactoring with SOLID Principles (FalafelCon 2013)Refactoring with SOLID Principles (FalafelCon 2013)
Refactoring with SOLID Principles (FalafelCon 2013)
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013
 
Refactoring with SOLID - Telerik India DevCon 2013
Refactoring with SOLID - Telerik India DevCon 2013Refactoring with SOLID - Telerik India DevCon 2013
Refactoring with SOLID - Telerik India DevCon 2013
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID Principles
 
Common asp.net design patterns aspconf2012
Common asp.net design patterns aspconf2012Common asp.net design patterns aspconf2012
Common asp.net design patterns aspconf2012
 
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Add Some DDD to Your ASP.NET MVC, OK?

  • 1. ADD SOME DDDTO YOURASP.NET MVC, OK? STEVE SMITH CTO, FALAFEL SOFTWARE @ARDALIS| STEVE.SMITH@FALAFEL.COM
  • 2. WHAT IS DOMAIN-DRIVEN DESIGN (DDD)?
  • 3.
  • 4. Communication •Ubiquitous Language •Domain Expert Interaction Modeling •Core Domain •Generic Subdomains •Bounded Context •Context Map •Shared Kernel •Anti-Corruption Layer Implementation •Model-Driven Design •Layered Architecture •Entities •Value Objects •Services •Factories •Aggregates •Repositories •Domain Events
  • 5. DDD IS BIG “THE MORE YOU KNOW, THE MORE YOU REALIZE YOU KNOW NOTHING.” SOCRATES
  • 6. DDD FUNDAMENTALS COURSE •OVER 4 HOURS OF CONTENT (DEMOS USING MVC + SIGNALR) •HTTP://BIT.LY/PS-DDD
  • 7. DDD BENEFITS •FLEXIBILITY •SOFTWARE MODELS CUSTOMER’S UNDERSTANDING OF PROBLEM •BREAKS COMPLEXITY INTO MANAGEABLE PIECES •Well-organized; easily tested •Business logic lives in one place
  • 8. DDD DRAWBACKS •TIME AND EFFORT •LEARNING CURVE •OVERKILL WITHOUT COMPLEXITY •“ANEMIC” DOMAIN MODEL PROBLEM
  • 9. COMMUNICATION “AS SOFTWARE DEVELOPERS, WE FAIL IN TWO WAYS: WE BUILD THE THING WRONG, OR WE BUILD THE WRONG THING.” ME
  • 10.
  • 12. LANGUAGE “A PROJECT FACES SERIOUS PROBLEMS WHEN ITS LANGUAGE IS FRACTURED.” ERIC EVANS
  • 13. UBIQUITOUS LANGUAGE •UBIQUITOUS–ADJECTIVE. PRESENT, APPEARING, OR FOUND EVERYWHERE. •SYNONYMS: PERVASIVE, UNIVERSAL •USED WITHIN A GIVEN BOUNDED CONTEXT •USED IN CODE, DESIGN DOCUMENTS, AND CONVERSATIONS --EVERYWHERE
  • 14. DOMAINTERMS Domain Experts Problem Domain Core Domain Sub-Domains
  • 15. BOUNDED CONTEXTS •PROVIDE SEPARATION OF CONCERNS •LIMIT COMPLEXITY •SHOULD BE CLEARLY BOUNDEDAND SEPARATE
  • 17. Appointment Scheduling Billing Anti- Corruption Layer
  • 18. MODEL DRIVEN DESIGN NOTDATA-DRIVEN
  • 19. LAYERED ARCHITECTURE •PORTS AND ADAPTERS •HEXAGONAL •ONION
  • 20. ORGANIZING IN A SOLUTION
  • 21. ENTITIES “MANY OBJECTS ARE NOT FUNDAMENTALLY DEFINED BY THEIR ATTRIBUTES, BUT RATHER BY A THREAD OF CONTINUITY AND IDENTITY.” ERIC EVANS
  • 22. CHANGING ATTRIBUTES DOESN’T CHANGE WHICH ONE WE’RE TALKING ABOUT ID:1 •Name: Steve Smith •Twitter: @ardalis •Favorite Color: Blue ID: 1 •Name: StevenSmith •Twitter: @ardalis •Favorite Color: Blue ID: 1 •Name: Steven Smith •Twitter: @ardalis •Favorite Color: Orange
  • 23.
  • 24.
  • 25. VALUE OBJECTS •DEFINED BY THEIR ATTRIBUTES •IMMUTABLE •SHOULD HAVE NO SIDE EFFECTS •EXAMPLES: STRINGS, ADDRESSES, CURRENCY
  • 26.
  • 28. DOMAIN SERVICES •NOT A NATURAL PART OF AN ENTITY OR VALUE OBJECT •INTERFACEDEFINED IN TERMS OF OTHER MODEL ELEMENTS •SHOULD BE STATELESS(BUT MAY HAVE SIDE EFFECTS)
  • 29. SERVICES IN DIFFERENT LAYERS UI Layer & Application Layer Infrastructure Domain (“Application Core”) Message Sending Message Processing XML Parsing UI Services Transfer Between Accounts Process Order Send Email Log to a File
  • 30. DOMAIN EVENTS “USE A DOMAIN EVENT TO CAPTURE AN OCCURRENCE OF SOMETHING THAT HAPPENED IN THE DOMAIN.” VAUGHN VERNON IMPLEMENTING DOMAIN-DRIVEN DESIGN
  • 31. DOMAIN EVENT TIPS •CONSIDER FOR CASES OF “WHENTHIS HAPPENS, THEN…” •OR “NOTIFY SOMEONE WHEN…” •DOMAIN EVENTS REPRESENT THE PAST •THEY ALREADY HAPPENED •THUS, THEY SHOULD BE IMMUTABLE
  • 32. EXAMPLES OF DOMAIN EVENTS UserAuthenticated Appointment Confirmed PaymentReceived $¢£¥
  • 33. DESIGNING DOMAIN EVENTS •EACH EVENT IS A CLASS •USE A COMMON INTERFACE (E.G. IDOMAINEVENT) •CAPTURE WHEN THE EVENT TOOK PLACE •INCLUDE DETAILS •WHAT WOULD YOU NEED TO KNOW TO TRIGGER THIS EVENT AGAIN? •INCLUDE IDENTITIESOF ANY ENTITIESINVOLVED •INITIALIZE ALL STATE IN CONSTRUCTOR •NO BEHAVIOR OR SIDE EFFECTS –JUST STATE
  • 34. MORE DDD TOPICS •AGGREGATES •REPOSITORIES •FACTORIES Learn More: DDD Fundamentals on Pluralsight Eric Evans’ DDD Book Email: steve.smith@falafel.com
  • 35. DOMAIN MODELS AND MVC MODELS •UI INTERACTS DIRECTLY WITH DOMAIN MODEL •ENTITIES, VALUE OBJECTS •INTERFACES, SERVICES •VIEWS MAY WORK WITH CUSTOM VIEWMODELS •CLIENT (HTML/JS) CODE MAY USE ANOTHER (CLIENT-SIDE) VIEWMODELAS WELL
  • 36. CONTROLLERS •KEEP AS SMALL AS POSSIBLE •ELIMINATE BUSINESS LOGIC •INJECT ALL DEPENDENCIES •HTTP://DEVIQ.COM/EXPLICIT-DEPENDENCIES-PRINCIPLE
  • 37. VIEWS •NO LOGIC UNLESS ENCAPSULATED IN TESTED HELPERS •NO BUSINESS LOGIC IF IT CAN INSTEAD BE MODELED IN THE DOMAIN
  • 38. SIGNALR •AWESOME ADDITION TO ASP.NET •GREAT FOR NOTIFICATIONS TO MULTIPLE USERS •TIES IN EASILY WITH DOMAIN EVENTS •EVENT HANDLERS CAN BE ADDED TO UI PROJECT
  • 39. SOLUTION STRUCTURE •CORE •INTERFACES •MODEL (ENTITIES, VALUE OBJECTS) •DOMAIN SERVICES •INFRASTRUCTURE •DBCONTEXT •FILE ACCESS •SYSTEM CLOCK ACCESS •EMAIL SERVICES •WEB •MVC PROJECT •NO DIRECT USE OF INFRASTRUCTURE
  • 40. DEMO PUTTING DDD INTO ASP.NET MVC