SlideShare une entreprise Scribd logo
1  sur  46
crafted design sandromancuso 
an introduction to Interaction-Driven Design (IDD)
 What is this application about? 
 What are the main concepts? 
 What does this application do? 
 What are the main features? 
 Where do I change it? 
 Where do I add a new feature or fix a bug?
 Badly structured packages/namespaces 
 Architectural and design concepts mixed with domain 
 Classes and methods are too low level 
 Acceptance tests either absent or badly written
Example: Layered structure
Example: Layered-domain structure
Example: MVC structure
MVC & MVC Variations 
• MVC (Smalltalk 76/80) 
• MVC (general concept – 1988) 
• Three-Tier Architecture (Presentation, Logic, 
Data) 
• MVC (Model 1/Model 2) 
• Model View Adapter (MVA) 
• Model View Presenter (MVP) 
• Model View ViewModel (MVVM) 
• Presentation-Abstraction-Control (PAC) 
• ….
Views impact MVC structure 
Depending on the view technology, Views and Controllers 
responsibility becomes more/less coupled or blurred. 
 Traditional multi-page web applications 
 Single-page AJAX applications with stateless backend 
 Console-based applications 
 Desktop applications 
 Games 
 Mobile / tablets 
 External systems (talking via Queues / Webservices) 
However, the model should remain unchanged.
Anaemic 
Domain 
MVC 
used 
badly 
Fat 
Controllers 
Coupling 
with MVC 
framework
MVC – A Macro Organisational Pattern 
V C M 
Model 
Delivery 
Mechanism
“Model” is overloaded and 
confusing 
 Model (M in MVC) 
 Domain Model (DDD) 
 View Model 
 Data Model 
 Entities & Active Record 
 and other artificial definitions from MVC frameworks 
 Associated with the persistence mechanism?
M => Domain Model (DDD) 
Domain Model combines state and behaviour, 
with more focus on the latter. 
DDD define a few building blocks to your domain: 
 Entities 
 Value Objects 
 Factories 
 Repositories 
 Services 
 Application 
 Domain 
 Infrastructure 
 Aggregates
View, Controller, Domain Model 
Model V C DM 
Delivery 
Mechanism 
DB 
Queue
Embedded Domain Model 
<< Web app >> 
Model V C DM 
Infrastructure Infrastructure 
Delivery 
Mechanism 
DB 
Queue
Deployable Domain Model 
<< mobile app >> 
<< external system >> 
Delivery 
Mechanisms 
DB 
<< deployable app >> 
Model 
Infrastructure 
DM 
<<W/S>> 
<<W/S>>
Event-Driven Domain Model 
<<event 1>> 
<< external app 1 >> << deployable app >> 
<< external app 2 >> 
Delivery 
Queue DM 
Queue 
Model 
Infrastructure 
Mechanisms DB 
<<event 2>>
Domain Model 
building blocks & responsibilities 
Model 
DM 
A 1 
R 3 
DS 1 
DS 2 
DS 3 
R 1 
S 
A 2 
Infrastructure Impl 
Impl 
<< web app >> 
A = Action, DS = Domain Service, S = Infra. Service, R = Repository
Behaviour: Action, Domain Service or Entity? 
Action Defines the action our domain model will be asked 
Domain 
Service 
Entity 
to perform. 
Behaviour related to multiple instances of the same entity 
or different entities. 
Behaviour that doesn’t fit any specific entity. 
Behaviour related to the data of a single instance of 
an entity
Repositories (not DAOs) 
Model 
<<repository>> 
Library 
<<repository>> 
Users 
Infrastructure 
<<Mongo>> 
Books 
Domain Model 
<<Oracle>> 
Users 
“A Repository represents all objects of a certain type as a conceptual set. It acts 
like a collection, except with more elaborate querying capability.” 
~ Eric Evans
An example would be good… 
Payment 
User Account 
has prime account? 
validate 
Make Validator 
Payment 
<<interface>> 
Card Processor 
Order 
History Orders 
Checker 
Users 
valid account? 
Payment 
pay Gateway 
process card 
store order 
<<interface>> 
Email Sender 
email confirmation 
Action Domain Service Infra. Service Repository Class
Class responsibility 
Produces the output 
End of flow 
Domain Model entry 
point Domain Concept 
entry point 
Input Output 
C A DS R 
cl 
End of code branch 
First to handle input 
Start of the flow 
Execution Flow 
 Closer to the input: Control flow, higher level abstraction, detailed work is delegated 
(e.g. ProcessTrade (A), MakePayment (A)) — More suitable for Outside-In TDD 
(mockist). 
 Closer to the output / end of branch: Specific and detailed behaviour, no delegation, 
lower level abstraction (e.g. Parse XML (Parser), Create User (Repository))
Domain Model collaborations guideline 
C1 
A 1 
X 
A 2 
DS 1 
DS 2 
DS 3 
DS 4 
R 1 
cl 
cl 
cl 
R 4 
cl 
X 
C2 A 3 X R 5 Except for read model 
C = Controller, A = Action, DS = Domain Service, R = Repository, cl = class
Command & Query Actions 
<< web app >> 
Model 
R 
<<Write Model>> 
DS 
A 
Model 
A R 
<<Read Model>> 
DB 
DB 
Queue <<domain events>>
So, how does the app structure look like?
Web project responsibility 
Delivery Mechanism: Defines the user journey 
Control flow (invoke actions) 
JSON / XML parsers or converters 
View Models, validators, etc 
Static files
Core responsibility (simple project) 
Tells what the system is about 
Tells what the system does
Core responsibility (bigger project) 
Related domain concepts 
Epic / Theme 
Epic / Theme 
Epic / Theme
What is inside model packages? 
Entity (part of Book aggregate) 
Aggregate root (entity) 
Repository 
Domain Service 
Part of aggregate behaviour 
Value Object (part of Book aggregate) 
Value Object (part of User aggregate) 
Aggregate root (entity) 
Repository 
Domain Service
What is inside infrastructure? 
Repository implementations 
CreditCardProcessor implementations 
Interfaces defined by the domain. 
Dependency Inversion Principle (DIP)
Interaction-Driven Design – IDD 
(Outside-In design) 
Input Output 
C A DS R 
cl 
Execution Flow 
Design Flow 
 Starting from the action, model the expected behaviour (outside-in) 
 Entities (data structures) will emerge in order to satisfy the behaviour 
 Focus is on the behaviour of the system and not on how data is stored/related
DB 
HTML 
JSON 
Feature 
1 Horizontal 
+ 
‘N’ Vertical slices
DB
Defining testing strategies and boundaries 
Types of tests 
• Unit 
• Integration 
• Acceptance 
• Journey 
• Black box 
• Component 
• System 
• Functional 
• Alpha 
• Beta 
• Conformance 
• …
Testing strategies: User Journey 
Model 
DM 
A 1 
A 2 
Designed according to User Stories 
and Features 
<< web app >> 
<<fake>> 
A 1 
<<fake>> 
A 2 
Tests the journey a user will have to do something 
useful in the system 
Application is tested as a black box normally using 
a BDD framework 
Actions are faked. We just want to know if the 
application presents the user with the correct 
journey
Testing strategies: Acceptance (Action / Behavioural) 
Tests a behaviour (action) provided by the system 
A DS 1 
<<mock>> 
DS 2 R R 
Infrastructure Impl 
Action is the entry point and 
all external dependencies are 
stubbed 
Domain Model 
Normally tested using a BDD 
framework
Testing strategies: Integration 
Tests the classes at the system boundaries 
Domain Model 
A DS 1 
<<mock>> 
DS 2 R R 
Infrastructure Impl 
Normally done using an in-memory 
Database using a unit 
testing framework
Testing strategies: Unit (Class level) 
Unit test at class/method level 
Infrastructure 
Impl 
A DS 1 
DS 2 R R 
Domain Model 
DS 1 
DS 2 
All collaborators are 
mocked / stubbed 
(spies)
Testing strategies: End-to-End 
Model 
DM 
A 1 
R 3 
DS 1 
DS 2 
DS 3 
R 1 
S 
Infrastructure Impl 
Impl 
A 2 
Full application deployed 
<< web app >> 
Uses BDD framework, accessing a testing database and 
fake external dependencies 
Very few tests at this level, just to make sure 
application is wired properly
Use libraries, not frameworks
TDD is easy. Hard is to design software well.
cl cl 
Input Output 
C A DS R 
DS 
Execution Flow 
Outside-In TDD 
Design Flow 
cl 
cl 
cl 
 The closer to the input a class is, the more flow control and delegation it does. 
 The closer to the output a class is, the more specific it is and less delegation it does
Answering the two original questions 
 What is the application about? (main concepts) 
Expressed by nouns 
 What does the application do? (main capabilities) 
Expressed by verbs 
(Actions)
Thank You 
@sandromancuso

Contenu connexe

Tendances

gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019James Newton-King
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Chris Richardson
 
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)Carlos Buenosvinos
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignAndriy Buday
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOTVMware Tanzu
 
Non functional requirements. do we really care…?
Non functional requirements. do we really care…?Non functional requirements. do we really care…?
Non functional requirements. do we really care…?OSSCube
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react formYao Nien Chung
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js SimplifiedSunil Yadav
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introductionBhagath Gopinath
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and HailoMicroservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailogjuljo
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 

Tendances (20)

Domain driven design
Domain driven designDomain driven design
Domain driven design
 
gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...
 
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)
Hexagonal Architecture - PHP Barcelona Monthly Talk (DDD)
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
 
Non functional requirements. do we really care…?
Non functional requirements. do we really care…?Non functional requirements. do we really care…?
Non functional requirements. do we really care…?
 
Microservices
MicroservicesMicroservices
Microservices
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react form
 
React workshop
React workshopReact workshop
React workshop
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Microservices Decomposition Patterns
Microservices Decomposition PatternsMicroservices Decomposition Patterns
Microservices Decomposition Patterns
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and HailoMicroservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 

En vedette

Legacy Code Hands-on Session
Legacy Code Hands-on Session Legacy Code Hands-on Session
Legacy Code Hands-on Session Sandro Mancuso
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?Sandro Mancuso
 
Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014Sandro Mancuso
 
Crafted Design - LJC World Tour Mash Up 2014
Crafted Design - LJC World Tour Mash Up 2014Crafted Design - LJC World Tour Mash Up 2014
Crafted Design - LJC World Tour Mash Up 2014Sandro Mancuso
 
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014TSundberg
 
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014Sandro Mancuso
 
Software Craftsmanship - JAX London 2011
Software Craftsmanship - JAX London 2011Software Craftsmanship - JAX London 2011
Software Craftsmanship - JAX London 2011Sandro Mancuso
 
Software Craftsmanship
Software CraftsmanshipSoftware Craftsmanship
Software CraftsmanshipSandro Mancuso
 

En vedette (8)

Legacy Code Hands-on Session
Legacy Code Hands-on Session Legacy Code Hands-on Session
Legacy Code Hands-on Session
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?
 
Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014
 
Crafted Design - LJC World Tour Mash Up 2014
Crafted Design - LJC World Tour Mash Up 2014Crafted Design - LJC World Tour Mash Up 2014
Crafted Design - LJC World Tour Mash Up 2014
 
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014
BDD with Cucumber-JVM as presented at I T.A.K.E. Unconference in Bucharest 2014
 
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
 
Software Craftsmanship - JAX London 2011
Software Craftsmanship - JAX London 2011Software Craftsmanship - JAX London 2011
Software Craftsmanship - JAX London 2011
 
Software Craftsmanship
Software CraftsmanshipSoftware Craftsmanship
Software Craftsmanship
 

Similaire à Crafted Design - Sandro Mancuso

The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
 
Introduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTUREIntroduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTUREIvano Malavolta
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDigendra Vir Singh (DV)
 
CQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same ApplicationsCQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same ApplicationsCodeFest
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 
Software Architecture
Software ArchitectureSoftware Architecture
Software ArchitectureHenry Muccini
 
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerAction-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerPaul Jones
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDennis Doomen
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net coreSam Nasr, MCSA, MVP
 
"Up-Down Development & DSL-first approach", Владимир Мельник, DataArt
 "Up-Down Development & DSL-first approach", Владимир Мельник, DataArt "Up-Down Development & DSL-first approach", Владимир Мельник, DataArt
"Up-Down Development & DSL-first approach", Владимир Мельник, DataArtDataArt
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arpGary Pedretti
 
Distributed information sys
Distributed information sysDistributed information sys
Distributed information sysMeena Chauhan
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaLucas Jellema
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azureSergey Seletsky
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShimon Tolts
 

Similaire à Crafted Design - Sandro Mancuso (20)

The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Introduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTUREIntroduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTURE
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltd
 
Sw Software Design
Sw Software DesignSw Software Design
Sw Software Design
 
CQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same ApplicationsCQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same Applications
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
Requirements engineering in agile
Requirements engineering in agileRequirements engineering in agile
Requirements engineering in agile
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerAction-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
L19 Application Architecture
L19 Application ArchitectureL19 Application Architecture
L19 Application Architecture
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservices
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
"Up-Down Development & DSL-first approach", Владимир Мельник, DataArt
 "Up-Down Development & DSL-first approach", Владимир Мельник, DataArt "Up-Down Development & DSL-first approach", Владимир Мельник, DataArt
"Up-Down Development & DSL-first approach", Владимир Мельник, DataArt
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
Distributed information sys
Distributed information sysDistributed information sys
Distributed information sys
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azure
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
 

Plus de JAXLondon2014

GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovGridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovJAXLondon2014
 
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimPerformance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimJAXLondon2014
 
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...JAXLondon2014
 
Conditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyConditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyJAXLondon2014
 
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniFinding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniJAXLondon2014
 
API Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleAPI Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleJAXLondon2014
 
'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh LongJAXLondon2014
 
The Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongThe Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongJAXLondon2014
 
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniJAXLondon2014
 
Dataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderDataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderJAXLondon2014
 
Habits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgHabits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgJAXLondon2014
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsThe Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsJAXLondon2014
 
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopTesting within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopJAXLondon2014
 
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...JAXLondon2014
 
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovSqueezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovJAXLondon2014
 
Spocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderSpocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderJAXLondon2014
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeJAXLondon2014
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzJAXLondon2014
 
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeRapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeJAXLondon2014
 
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...JAXLondon2014
 

Plus de JAXLondon2014 (20)

GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovGridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
 
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimPerformance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
 
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
 
Conditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyConditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean Reilly
 
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniFinding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
 
API Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleAPI Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul Fremantle
 
'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long
 
The Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongThe Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh Long
 
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
 
Dataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderDataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel Winder
 
Habits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgHabits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn Verburg
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsThe Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
 
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopTesting within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
 
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
 
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovSqueezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
 
Spocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderSpocktacular Testing - Russel Winder
Spocktacular Testing - Russel Winder
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz Kabutz
 
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeRapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
 
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
 

Dernier

ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 

Dernier (20)

ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 

Crafted Design - Sandro Mancuso

  • 1. crafted design sandromancuso an introduction to Interaction-Driven Design (IDD)
  • 2.  What is this application about?  What are the main concepts?  What does this application do?  What are the main features?  Where do I change it?  Where do I add a new feature or fix a bug?
  • 3.  Badly structured packages/namespaces  Architectural and design concepts mixed with domain  Classes and methods are too low level  Acceptance tests either absent or badly written
  • 7.
  • 8. MVC & MVC Variations • MVC (Smalltalk 76/80) • MVC (general concept – 1988) • Three-Tier Architecture (Presentation, Logic, Data) • MVC (Model 1/Model 2) • Model View Adapter (MVA) • Model View Presenter (MVP) • Model View ViewModel (MVVM) • Presentation-Abstraction-Control (PAC) • ….
  • 9. Views impact MVC structure Depending on the view technology, Views and Controllers responsibility becomes more/less coupled or blurred.  Traditional multi-page web applications  Single-page AJAX applications with stateless backend  Console-based applications  Desktop applications  Games  Mobile / tablets  External systems (talking via Queues / Webservices) However, the model should remain unchanged.
  • 10. Anaemic Domain MVC used badly Fat Controllers Coupling with MVC framework
  • 11. MVC – A Macro Organisational Pattern V C M Model Delivery Mechanism
  • 12. “Model” is overloaded and confusing  Model (M in MVC)  Domain Model (DDD)  View Model  Data Model  Entities & Active Record  and other artificial definitions from MVC frameworks  Associated with the persistence mechanism?
  • 13. M => Domain Model (DDD) Domain Model combines state and behaviour, with more focus on the latter. DDD define a few building blocks to your domain:  Entities  Value Objects  Factories  Repositories  Services  Application  Domain  Infrastructure  Aggregates
  • 14. View, Controller, Domain Model Model V C DM Delivery Mechanism DB Queue
  • 15. Embedded Domain Model << Web app >> Model V C DM Infrastructure Infrastructure Delivery Mechanism DB Queue
  • 16. Deployable Domain Model << mobile app >> << external system >> Delivery Mechanisms DB << deployable app >> Model Infrastructure DM <<W/S>> <<W/S>>
  • 17. Event-Driven Domain Model <<event 1>> << external app 1 >> << deployable app >> << external app 2 >> Delivery Queue DM Queue Model Infrastructure Mechanisms DB <<event 2>>
  • 18. Domain Model building blocks & responsibilities Model DM A 1 R 3 DS 1 DS 2 DS 3 R 1 S A 2 Infrastructure Impl Impl << web app >> A = Action, DS = Domain Service, S = Infra. Service, R = Repository
  • 19. Behaviour: Action, Domain Service or Entity? Action Defines the action our domain model will be asked Domain Service Entity to perform. Behaviour related to multiple instances of the same entity or different entities. Behaviour that doesn’t fit any specific entity. Behaviour related to the data of a single instance of an entity
  • 20. Repositories (not DAOs) Model <<repository>> Library <<repository>> Users Infrastructure <<Mongo>> Books Domain Model <<Oracle>> Users “A Repository represents all objects of a certain type as a conceptual set. It acts like a collection, except with more elaborate querying capability.” ~ Eric Evans
  • 21. An example would be good… Payment User Account has prime account? validate Make Validator Payment <<interface>> Card Processor Order History Orders Checker Users valid account? Payment pay Gateway process card store order <<interface>> Email Sender email confirmation Action Domain Service Infra. Service Repository Class
  • 22. Class responsibility Produces the output End of flow Domain Model entry point Domain Concept entry point Input Output C A DS R cl End of code branch First to handle input Start of the flow Execution Flow  Closer to the input: Control flow, higher level abstraction, detailed work is delegated (e.g. ProcessTrade (A), MakePayment (A)) — More suitable for Outside-In TDD (mockist).  Closer to the output / end of branch: Specific and detailed behaviour, no delegation, lower level abstraction (e.g. Parse XML (Parser), Create User (Repository))
  • 23. Domain Model collaborations guideline C1 A 1 X A 2 DS 1 DS 2 DS 3 DS 4 R 1 cl cl cl R 4 cl X C2 A 3 X R 5 Except for read model C = Controller, A = Action, DS = Domain Service, R = Repository, cl = class
  • 24. Command & Query Actions << web app >> Model R <<Write Model>> DS A Model A R <<Read Model>> DB DB Queue <<domain events>>
  • 25. So, how does the app structure look like?
  • 26. Web project responsibility Delivery Mechanism: Defines the user journey Control flow (invoke actions) JSON / XML parsers or converters View Models, validators, etc Static files
  • 27. Core responsibility (simple project) Tells what the system is about Tells what the system does
  • 28. Core responsibility (bigger project) Related domain concepts Epic / Theme Epic / Theme Epic / Theme
  • 29. What is inside model packages? Entity (part of Book aggregate) Aggregate root (entity) Repository Domain Service Part of aggregate behaviour Value Object (part of Book aggregate) Value Object (part of User aggregate) Aggregate root (entity) Repository Domain Service
  • 30. What is inside infrastructure? Repository implementations CreditCardProcessor implementations Interfaces defined by the domain. Dependency Inversion Principle (DIP)
  • 31. Interaction-Driven Design – IDD (Outside-In design) Input Output C A DS R cl Execution Flow Design Flow  Starting from the action, model the expected behaviour (outside-in)  Entities (data structures) will emerge in order to satisfy the behaviour  Focus is on the behaviour of the system and not on how data is stored/related
  • 32. DB HTML JSON Feature 1 Horizontal + ‘N’ Vertical slices
  • 33. DB
  • 34. Defining testing strategies and boundaries Types of tests • Unit • Integration • Acceptance • Journey • Black box • Component • System • Functional • Alpha • Beta • Conformance • …
  • 35. Testing strategies: User Journey Model DM A 1 A 2 Designed according to User Stories and Features << web app >> <<fake>> A 1 <<fake>> A 2 Tests the journey a user will have to do something useful in the system Application is tested as a black box normally using a BDD framework Actions are faked. We just want to know if the application presents the user with the correct journey
  • 36. Testing strategies: Acceptance (Action / Behavioural) Tests a behaviour (action) provided by the system A DS 1 <<mock>> DS 2 R R Infrastructure Impl Action is the entry point and all external dependencies are stubbed Domain Model Normally tested using a BDD framework
  • 37. Testing strategies: Integration Tests the classes at the system boundaries Domain Model A DS 1 <<mock>> DS 2 R R Infrastructure Impl Normally done using an in-memory Database using a unit testing framework
  • 38. Testing strategies: Unit (Class level) Unit test at class/method level Infrastructure Impl A DS 1 DS 2 R R Domain Model DS 1 DS 2 All collaborators are mocked / stubbed (spies)
  • 39. Testing strategies: End-to-End Model DM A 1 R 3 DS 1 DS 2 DS 3 R 1 S Infrastructure Impl Impl A 2 Full application deployed << web app >> Uses BDD framework, accessing a testing database and fake external dependencies Very few tests at this level, just to make sure application is wired properly
  • 40. Use libraries, not frameworks
  • 41. TDD is easy. Hard is to design software well.
  • 42. cl cl Input Output C A DS R DS Execution Flow Outside-In TDD Design Flow cl cl cl  The closer to the input a class is, the more flow control and delegation it does.  The closer to the output a class is, the more specific it is and less delegation it does
  • 43. Answering the two original questions  What is the application about? (main concepts) Expressed by nouns  What does the application do? (main capabilities) Expressed by verbs (Actions)
  • 44.
  • 45.

Notes de l'éditeur

  1. In this talk I’ll be sharing how I’ve been designing software in the past few years. I’ll be talking about a design style that I’m calling Interaction-Driven Design (IDD) To be catchy it needs to be Japanese or xDD. Chose the latter cos I don’t speak Japanese.
  2. For years I’ve been trying to find ways to, while looking from above, answer the following questions:
  3. Looking from above: controllers, repositories, managers, services, etc. Layers vs. domain? How do they fit together? How many of you are happy with your package structure?
  4. Confusing. I have no idea what this application is about or what it does. What does this application do? What is it about?
  5. Gives me some information on what the application is about but not what it does. Loads of duplication Very poluted Books and Users. Cool, but what does this application do?
  6. Once again, gives me no information on what the application is about or what it does. But I know it is a web app though. Sigh. Awesome. It’s a web application. So?
  7. So, how do I solve the problem? How do I answer the questions? But first things first… Before getting into how I’m organising/structuring my code, we need some background to justify my decisions
  8. It was only later, in a 1988 article in Glenn E. Krasner and Stephen T. Pope that MVC was expressed as general concept, in the The Journal of Object Technology
  9. Anaemic Domain: Model is only composed by entities and data structures Fat Controllers: Without a place to put business logic, the logic is put on the controllers
  10. What should we have in the model? What is model?
  11. Start our application with this clear separation or refactor towards it. Keeping them separately gives us options.
  12. Domain Model embedded in a Web Application V/C belong to the application (main)
  13. Domain Model wrapped in a deployable application Expose a W/S for mobile apps / Web apps / External Systems This is similar to Hexagonal Architecture (Ports & Adapters belong to Infrastructure) Mobile app could have the V/C
  14. Event-Driven application
  15. - Actions are the entry point to the domain model (control flow delegating to Domain Services) - Actions can use factories to create domain objects according to the input (normally not in the domain format) - Domain Services are the entry point to a domain concept. Repositories are helpers to the Domain Service and should not be exposed.
  16. - I name repositories using the plural (collection) of the domain concept they represent (Users, Books) Repository vs. DAO (Former behaves as a collection. Latter is a pattern to access data) Data Access Object (DAO) is a commonly used pattern to persist entities (data) into a database. (CRUD)
  17. Classes closer to the output are more suitable for Classic TDD, unless they are close to the boundaries (that need to be mocked in both TDD styles)
  18. Controller can talk to one or more than one action UC can talk to one or more DS or classes DS can talk to other DS or Infra Service Repositories are never exposed. Just accessed by its own DS. Exception is on Read Model
  19. - Write model throws domain events Query model listens to domain events and populate “read” DB Query UC return data according to the application needs (Report, Complex Screen with denormalised data, etc) Command Actions go though the domain model, delegating to domain services Query Actions may go to a read model instead, querying with joins returning VOs that are specific to the UI. No need to organise them in different packages (using command & query as names)
  20. Controllers talk the Actions Controllers should be thin, invoking an action, and choosing the view to be displayed (maybe creating page objects or converting to JSON?) web: View (page objects) Web: Infrastructure (JSON / XML parsers or converters)
  21. Controllers talk the Actions Controllers should be thin, invoking an action, and choosing the view to be displayed (maybe creating page objects or converting to JSON?) web: View (page objects) Web: Infrastructure (JSON / XML parsers or converters)
  22. In a simple project (CRUD), action may be as simple as Insert, Delete, Update User Not all action se cases have a direct correlation to entities (AddBookToWishList)
  23. Epics/Themes: Candidates for bounded contexts / (micro?) services MakePayment UC does not need to have a related Entity, neither FindRecommendations. MakePayment may sent information out to a different system FindRecommendations may return a list of products (after a very complicated logic, taking to consideration user attributes and buying patterns)
  24. Many of the DDD building blocks
  25. Decouples the architectural decisions and layers from the domain model.
  26. A class API (public interface) should be designed from the client’s perspective. Doing otherwise leads to over-engineering and YAGNI – You Ain’t Gonna Need It Businesses are not interested in how data is stored or related. They are interested in the behaviour of the software.
  27. First, discuss with your team and define the scope of each test Then, chose a name for each scope
  28. Mocking the backend makes these tests run really fast and predictable. Easy to setup
  29. Tests multiple classes together. External dependencies are stubbed
  30. Tests multiple classes together. External dependencies are stubbed
  31. Tests multiple classes together. External dependencies are stubbed
  32. Unit (class / method level) Acceptance (through action, in-memory/mocked DB/infrastructure) Integration (via the boundaries, in-memory DB) User Journey (Via the UI – mocking action) End-to-end (black box, very few, just sunny day scenario) The closer to the input a class is, the more flow control and delegation it does. The closer to the output a class is, the more specific and less delegation it does.
  33. How to enable good design and test? You need freedom to design and test. Don’t use frameworks. Take control of your application. Don’t be scared to write code. Embedded Jetty, Scalatra, SparkJava Anorm (back to JDBC basics) Transaction service Remember when Spring was a lightweight alternative to J2EE?
  34. London School vs. Chicago/Detroit School
  35. The closer to the input a class is, the more flow control and delegation it does. The closer to the output a class is, the more specific and less delegation it does.
  36. Listen to your tests: shallow advice. Klaus story about music.
  37. A class API (public interface) should be designed from the client’s perspective. Doing otherwise leads to over-engineering and YAGNI – You Ain’t Gonna Need It Businesses are not interested in how data is stored or related. They are interested in the behaviour of the software.
  38. Businesses can move just as fast as they can create or change software, making them hostages of their own software.
  39. Codurance: We believe that softtware dev is a craft. We believe that how it is done is as important as getting it done. We believe that delivering well-crafted code is the best way we can help our clients.
  40. Codurance: We believe that softtware dev is a craft. We believe that how it is done is as important as getting it done. We believe that delivering well-crafted code is the best way we can help our clients.