Upload
alessandro-melchiori
View
499
Download
0
Tags:
Embed Size (px)
Citation preview
Beyond DDD: uno sguardo a CQRS and event sourcing
about me
{
"firstName": "Alessandro",
"lastName": "Melchiori",
"role": "software architect @ codiceplastico",
"contacts": [
{ "type": "email", "value": [email protected] },
{ "type": "twitter", "value": "@amelchiori" },
{ "type": "blog", "value": http://blog.codiceplastico.com/melkio }
]
}
Il contesto• Applicazione finanziaria (non “always online”)
• Circa 70 utenti
• 250.000+ aziende
• 750.000+ bilanci
• 70.000.000+ voci di bilancio
• 16.000+ call/mese
• “Pluggato” a servizi di terze parti
• Picchi di lavoro “temporali” (…la nuvola può darci una mano)
Agenda
• Com’era
• Com’è
• Come sarà
Come era…Pr
esen
tatio
n La
yer
Serv
ice/
Appl
icati
on L
ayer
Dom
ain
Mod
el
Storage
Come era…
Come era…
Come era…
I problemi…
• Logica (mal) sparpagliata
• Contesti non definiti
• Modello “fragile” e poco propenso alle evoluzioni
• Un unico modello per la lettura e per la scrittura
• Prestazioni
• UI “generazionalista”
DDD: brevi cenni
• Use AGGREGATES as unit of consistency across your domain model
• Protect your model with clearly defined BOUNDED CONTEXT
(Eric Evans)
BC 01 BC 02 BC 03
DDD: brevi cenni
• It’s really become clear to me in the last couple of years that we need a new building block and that is the Domain Events
(Eric Evans)
BC 01 BC 02 BC 03
CQRS / ES: brevi cenni
• Every method should either be a command that performs an action, or a query that returns data to the caller, but NOT BOTH
(Bertrand Meyer)
CQRS / ES: brevi cenni
• A single model cannot be appropriate for reporting, searching and transactional behavior
• State transition are an important part of our problem space and should be modeled within our domain
(Greg Young, 2008)
L’evoluzione
Come è…Pr
esen
tatio
n La
yer
Serv
ice
Laye
r
Dom
ain
Mod
el
Write storage
Read storage
Come sarà…
AZURE ?Service Bus
Blob Storage
Worker / Web Role
MongoDb (PaaS or SaaS)
ACS
Quando DDD/CQRS/ES fanno per me?
Chiedilo al «tuo» UBIQUITOUS LANGUAGE
(Alessandro Melchiori)
Quando DDD/CQRS/ES fanno per me?
Tackling Complexity in the Heart of Software