You are on page 1of 25

Domain-centric Architecture

Matthew Renze
SOFTWARE CONSULTANT

@matthewrenze www.matthewrenze.com
Overview Domain-centric Architecture
Types of Domain-centric Architectures
Pros and Cons
Demo
Venus

Mercury
Earth
Mars
Sun

Moon

Saturn
Jupiter
Earth

Mercury
Mars
Venus Sun

Saturn
Jupiter
Venus Earth

Mercury
Earth Mercury
Mars Mars
Sun Venus Sun

Moon

Saturn Saturn
Jupiter Jupiter

Geocentric Model Heliocentric Model


Classic Three-layer
Database-centric Architecture
UI

Business Logic

Data Access
Database
Database
Database-centric vs.
Domain-centric Architecture
UI Presentation

Business Logic Application

Data Access
Database Domain
Database
Database

Database
“The first concern of the architect
is to make sure that the house is
usable, it is not to ensure that the
house is made of brick.”
- Uncle Bob
Essential vs. Detail

Space is essential
Usability is essential
Essential vs. Detail

Space is essential
Usability is essential
Building material is a detail
Ornamentation is a detail
Essential vs. Detail

Domain is essential
Use cases are essential
Essential vs. Detail

Domain is essential
Use cases are essential
Presentation is a detail
Persistence is a detail
Database-centric vs.
Domain-centric Architecture
UI Presentation

Business Logic Application

Data Access
Database Domain
Database
Database

Database
Hexagonal Architecture

answering
machine
adapter

email
adapter
http
feed
mock
telephone
Application
GUI
database
http adapter
adapter DB

app-to-app mock
adapter database
app
test
adapter

Original source: http://alistair.cockburn.us/Hexagonal+architecture


Onion Architecture
User Interface

Application Services

Domain Services

Domain
Database
Model

Application Core
web
service

file

DB

Original source: http://jeffreypalermo.com/blog/the-onion-architecture-part-2/


The Clean Architecture

Controllers

Use Cases

Database
Entities
I
Use case
Presenter
output port

Flow
of Use case
Control interactor

I
Use case
External Controller
input port
Interfaces
Original source: http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
It’s All the Same Thing

Hexagonal Onion Clean

Original Source: http://blog.ploeh.dk/2013/12/03/layers-onions-ports-adapters-its-all-the-same/


Why Use Domain-centric Architecture?

Presentation

Pros Application

Focus on domain
Domain
Database
Less coupling
Allows for DDD

Database
Why Use Domain-centric Architecture?

Pros Cons
Focus on domain Change is difficult
Less coupling Requires more thought
Allows for DDD Initial higher cost
Setup
Show Solution Organization
Show Domain Project
Show Sale Class
Wrap Up
Summary Domain-centric Architecture
Types of Domain-centric Architectures
Pros and Cons
Demo

You might also like