SlideShare a Scribd company logo
BILL NEWLAND
bill@utterclarity.co.uk
@UtterClarity
billnewland
NO ONIONS, NO TIERS
AN INTRODUCTION TO VERTICAL SLICE ARCHITECTURE
DISCLAIMER
This talk is not about microservices.
Any resemblance to microservices living or
departed are purely coincidental.
Database
Data Access Layer
UI Layer
Business Layer
A BIT OF HISTORY
• 3-Tier Architecture
• N-Tier Architecture
• Tight coupling between layers
UI
ONION ARCHITECTURE
• Direction of dependency is towards the
core
• Interaction between layers is via
interfaces
• Reduces coupling
• Implementation may change as long as
interfaces remain the same
• But a single change may still affect every
layer
Application Services
Domain Services
Domain
Model Change
WHY IS THIS A PROBLEM?
• Changes affect multiple service objects
• Increases the chances of merge conflicts
• Harder to test
• Increased complexity
‘MY BANK’ SCENARIO
Customer Loan Application
Loan
application
Check credit
score
Loan rejected
Loan
approved
Transfer
money
Ok
Not Ok
customerService
customerService accountService loanService
customerEntity accountEntity loanEntity
Apply for Loan
Get Customer Data
Get Customer Data Get Account Data
Evaluate Loan
Update Loan Book
Approve Loan
creditScorerService
Get Credit Score
Deposit Money
Update Balance
Update Customer
Get Account Data
Update Balance
Application
Service
Domain
Service
Domain
Model
Update Customer Data
WHAT’S THE ALTERNATIVE?
• Stop thinking about
separating layers
• Stop think about objects
• Start thinking about features
• Axes of change
UI Layer
Business Layer
Data Access Layer
Database
Open
Account
Balance
Enquiry
Loan
Application
Loan Application
COLLAPSING THE MODEL
Get
Customer
Data
Evaluate
Loan
Loan
Approved
Get Credit
Score
Update
Loan
Book
Get
Account
Data
Update
Balance
Database
Credit agency
Apply
for loan
Success
Loan
Rejected
Fail
IN PRACTICE
• Every user action has its own class
• Keep it contained
• Reuse is not your friend
• Input – Process - Output
Input Output
Process
• Synchronous Call
• Response to an event
• Promise
• Values
• Raise an event
• Fulfils promise
IT DOESN’T HAVE TO BE HOMOGONOUS
UI Layer
Business Layer
Data Access Layer
Database
Balance
Enquiry
Transfer
Money
Loan
Book
Report Website
Business Layer
Repository
No-SQL Db
Balance Enquiry
API
Business Layer
ORM
Main Db
Transfer Money
BI
Business Layer
SQL
Reporting Db
Loan Book Report
https://mybank.co.uk
…
…
…
…
…
…
My Bank Bill Newland
Money Transfer
Input Process Output
Loan Application
Input Process Output
Get Statement
Input Process Output
TASK-BASED USER INTERFACES
Transfer Loan Statement
VERTICALLY SLICED ARCHITECTURE
Validation
Authentication
Authorisation
Rarely
Used
Feature
Different
Feature
Another
Feature
Loan
Application
Get
Statement
Money
Transfer
Balance
Enquiry
Persistence
Domain
Agnostic
Domain
Specific
Cross-
Cutting
WHAT’S THE ADVANTAGE?
• Adding not changing
• Distinct merges
• Isolated testing
• Simpler
Validation
Authentication
Authorisation
Rarely
Used
Feature
Different
Feature
Another
Feature
Loan
Application
Get
Statement
Money
Transfer
Balance
Enquiry
Persistence
QUESTIONS?
BILL NEWLAND
bill@utterclarity.co.uk
@UtterClarity
billnewland
class LoanApplication extends Handler {
process(input: LoanApplicationInput): Output {
super.process(input);
const output = new LoanApplicationOutput {
success = true
};
return output;
}
}
class LoanApplicationInput extends Input {
accountNumber: string;
amount: number;
…
}
class LoanApplicationOutput extends Output {
success: boolean
}
class LoanResponse implements IResponse {
success: boolean
}
class LoanRequest implements IRequest<LoanResponse> {
accountNumber : string;
}
@RequestHandler(LoanRequest)
class HandlerTest implements IRequestHandler<LoanRequest, LoanResponse> {
handle(value: LoanRequest): Promise<LoanResponse> {
return Promise.resolve(new LoanResponse {
success: true
}
}
const mediator = new Mediator();
const r = new LoanRequest();
r.accountNumber = "AB-12345-96C";
const result = await mediator.send<LoanResponse>(r);
// result.success = true
Mediatr library: https://www.npmjs.com/package/mediatr-ts

More Related Content

What's hot

Transactions and Concurrency Control Patterns
Transactions and Concurrency Control PatternsTransactions and Concurrency Control Patterns
Transactions and Concurrency Control Patterns
J On The Beach
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
Victor Rentea
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
Kasun Indrasiri
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 Way
Debasish Ghosh
 
Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentation
Ahasanul Kalam Akib
 
Clean pragmatic architecture @ devflix
Clean pragmatic architecture @ devflixClean pragmatic architecture @ devflix
Clean pragmatic architecture @ devflix
Victor Rentea
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | Edureka
Edureka!
 
Outside-in Test Driven Development - the London School of TDD
Outside-in Test Driven Development - the London School of TDDOutside-in Test Driven Development - the London School of TDD
Outside-in Test Driven Development - the London School of TDD
Peter Kofler
 
The Power of Composition
The Power of CompositionThe Power of Composition
The Power of Composition
Scott Wlaschin
 
Clean code
Clean codeClean code
Clean code
Arturo Herrero
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
Mikalai Alimenkou
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Young-Ho Cho
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
wojtek_s
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
David Ehringer
 
Karate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made SimpleKarate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made Simple
VodqaBLR
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
Tom Kocjan
 
React introduction
React introductionReact introduction
React introduction
Võ Duy Tuấn
 
Integration testing with spring @snow one
Integration testing with spring @snow oneIntegration testing with spring @snow one
Integration testing with spring @snow one
Victor Rentea
 

What's hot (20)

Transactions and Concurrency Control Patterns
Transactions and Concurrency Control PatternsTransactions and Concurrency Control Patterns
Transactions and Concurrency Control Patterns
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 Way
 
Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentation
 
Clean pragmatic architecture @ devflix
Clean pragmatic architecture @ devflixClean pragmatic architecture @ devflix
Clean pragmatic architecture @ devflix
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | Edureka
 
Outside-in Test Driven Development - the London School of TDD
Outside-in Test Driven Development - the London School of TDDOutside-in Test Driven Development - the London School of TDD
Outside-in Test Driven Development - the London School of TDD
 
The Power of Composition
The Power of CompositionThe Power of Composition
The Power of Composition
 
Clean code
Clean codeClean code
Clean code
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Karate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made SimpleKarate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made Simple
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
React introduction
React introductionReact introduction
React introduction
 
Integration testing with spring @snow one
Integration testing with spring @snow oneIntegration testing with spring @snow one
Integration testing with spring @snow one
 

Similar to No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill Newland

Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
Mohammad Dameer
 
Microservices patterns short.pptx
Microservices patterns short.pptxMicroservices patterns short.pptx
Microservices patterns short.pptx
Jindřich Kubát
 
Knowledge drivenmicroservices
Knowledge drivenmicroservicesKnowledge drivenmicroservices
Knowledge drivenmicroservices
Maciej Swiderski
 
Systematic Migration of Monolith to Microservices
Systematic Migration of Monolith to MicroservicesSystematic Migration of Monolith to Microservices
Systematic Migration of Monolith to Microservices
Pradeep Dalvi
 
Introduction to Microservices with NService Bus
Introduction to Microservices with NService BusIntroduction to Microservices with NService Bus
Introduction to Microservices with NService Bus
Chris Morgan
 
QuickBooks Desktop: Going Out of Style Like VHS Tapes
QuickBooks Desktop: Going Out of Style Like VHS TapesQuickBooks Desktop: Going Out of Style Like VHS Tapes
QuickBooks Desktop: Going Out of Style Like VHS Tapes
Novi AMS
 
Common iOS Architecture: From MVC to VIPER, with Redux
Common iOS Architecture: From MVC to VIPER, with ReduxCommon iOS Architecture: From MVC to VIPER, with Redux
Common iOS Architecture: From MVC to VIPER, with Redux
Nelson Tai
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
Lucian Neghina
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EEDmitri Shiryaev
 
Refactoring for microservices
Refactoring for microservicesRefactoring for microservices
Refactoring for microservices
Ismael Rivera
 
Continuous Testing with Service Virtualization
Continuous Testing with Service VirtualizationContinuous Testing with Service Virtualization
Continuous Testing with Service Virtualization
SmartBear
 
Building a SaaS based product in Azure - Challenges and decisions made
Building a SaaS based product in Azure - Challenges and decisions madeBuilding a SaaS based product in Azure - Challenges and decisions made
Building a SaaS based product in Azure - Challenges and decisions made
BizTalk360
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
Victor_Cr
 
High Level Overview of Windows Azure - EPC Group
High Level Overview of Windows Azure - EPC GroupHigh Level Overview of Windows Azure - EPC Group
High Level Overview of Windows Azure - EPC Group
EPC Group
 
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service TestingContinuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
Cognizant
 
FinTechLabs Company Profile
FinTechLabs Company ProfileFinTechLabs Company Profile
FinTechLabs Company Profile
Vipul Rawal
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
Ashwini Kuntamukkala
 
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程Amazon Web Services
 

Similar to No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill Newland (20)

Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Microservices patterns short.pptx
Microservices patterns short.pptxMicroservices patterns short.pptx
Microservices patterns short.pptx
 
Knowledge drivenmicroservices
Knowledge drivenmicroservicesKnowledge drivenmicroservices
Knowledge drivenmicroservices
 
Systematic Migration of Monolith to Microservices
Systematic Migration of Monolith to MicroservicesSystematic Migration of Monolith to Microservices
Systematic Migration of Monolith to Microservices
 
Introduction to Microservices with NService Bus
Introduction to Microservices with NService BusIntroduction to Microservices with NService Bus
Introduction to Microservices with NService Bus
 
QuickBooks Desktop: Going Out of Style Like VHS Tapes
QuickBooks Desktop: Going Out of Style Like VHS TapesQuickBooks Desktop: Going Out of Style Like VHS Tapes
QuickBooks Desktop: Going Out of Style Like VHS Tapes
 
Common iOS Architecture: From MVC to VIPER, with Redux
Common iOS Architecture: From MVC to VIPER, with ReduxCommon iOS Architecture: From MVC to VIPER, with Redux
Common iOS Architecture: From MVC to VIPER, with Redux
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EE
 
Refactoring for microservices
Refactoring for microservicesRefactoring for microservices
Refactoring for microservices
 
Continuous Testing with Service Virtualization
Continuous Testing with Service VirtualizationContinuous Testing with Service Virtualization
Continuous Testing with Service Virtualization
 
Building a SaaS based product in Azure - Challenges and decisions made
Building a SaaS based product in Azure - Challenges and decisions madeBuilding a SaaS based product in Azure - Challenges and decisions made
Building a SaaS based product in Azure - Challenges and decisions made
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
 
High Level Overview of Windows Azure - EPC Group
High Level Overview of Windows Azure - EPC GroupHigh Level Overview of Windows Azure - EPC Group
High Level Overview of Windows Azure - EPC Group
 
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service TestingContinuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
 
FinTechLabs Company Profile
FinTechLabs Company ProfileFinTechLabs Company Profile
FinTechLabs Company Profile
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Scalability and performance for e commerce
Scalability and performance for e commerceScalability and performance for e commerce
Scalability and performance for e commerce
 
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程
Track 4 Session 3_ 利用 AWS Step Functions 建構穩健的業務處理流程
 

More from Alex Cachia

Supporting IT by David Meares
Supporting IT by David MearesSupporting IT by David Meares
Supporting IT by David Meares
Alex Cachia
 
OWASP Top 10 2021 - let's take a closer look by Glenn Wilson
OWASP Top 10 2021 - let's take a closer look by Glenn WilsonOWASP Top 10 2021 - let's take a closer look by Glenn Wilson
OWASP Top 10 2021 - let's take a closer look by Glenn Wilson
Alex Cachia
 
If you think open source is not for you, think again by Jane Chakravorty
If you think open source is not for you, think again by Jane ChakravortyIf you think open source is not for you, think again by Jane Chakravorty
If you think open source is not for you, think again by Jane Chakravorty
Alex Cachia
 
Chaos Engineering – why we should all practice breaking things on purpose by ...
Chaos Engineering – why we should all practice breaking things on purpose by ...Chaos Engineering – why we should all practice breaking things on purpose by ...
Chaos Engineering – why we should all practice breaking things on purpose by ...
Alex Cachia
 
A brief overview of the history and practice of user experience by Ian Westbrook
A brief overview of the history and practice of user experience by Ian WestbrookA brief overview of the history and practice of user experience by Ian Westbrook
A brief overview of the history and practice of user experience by Ian Westbrook
Alex Cachia
 
Return the carriage, feed the line by Aaron Taylor
Return the carriage, feed the line by Aaron TaylorReturn the carriage, feed the line by Aaron Taylor
Return the carriage, feed the line by Aaron Taylor
Alex Cachia
 
Treating your career path and training like leveling up in games by Raymond C...
Treating your career path and training like leveling up in games by Raymond C...Treating your career path and training like leveling up in games by Raymond C...
Treating your career path and training like leveling up in games by Raymond C...
Alex Cachia
 
Digital forensics and giving evidence by Jonathan Haddock
Digital forensics and giving evidence by Jonathan Haddock Digital forensics and giving evidence by Jonathan Haddock
Digital forensics and giving evidence by Jonathan Haddock
Alex Cachia
 
Software Security by Glenn Wilson
Software Security by Glenn WilsonSoftware Security by Glenn Wilson
Software Security by Glenn Wilson
Alex Cachia
 
Data Preparation and the Importance of How Machines Learn by Rebecca Vickery
Data Preparation and the Importance of How Machines Learn by Rebecca VickeryData Preparation and the Importance of How Machines Learn by Rebecca Vickery
Data Preparation and the Importance of How Machines Learn by Rebecca Vickery
Alex Cachia
 
Why Rust? by Edd Barrett (codeHarbour December 2019)
Why Rust? by Edd Barrett (codeHarbour December 2019)Why Rust? by Edd Barrett (codeHarbour December 2019)
Why Rust? by Edd Barrett (codeHarbour December 2019)
Alex Cachia
 
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
Alex Cachia
 
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
Alex Cachia
 
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
Alex Cachia
 
Revving up with Reinforcement Learning by Ricardo Sueiras
Revving up with Reinforcement Learning by Ricardo SueirasRevving up with Reinforcement Learning by Ricardo Sueiras
Revving up with Reinforcement Learning by Ricardo Sueiras
Alex Cachia
 
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
Alex Cachia
 
Seeking Simplicity by Phil Nash (codeHarbour June 2019)
Seeking Simplicity by Phil Nash (codeHarbour June 2019)Seeking Simplicity by Phil Nash (codeHarbour June 2019)
Seeking Simplicity by Phil Nash (codeHarbour June 2019)
Alex Cachia
 
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
Alex Cachia
 
Managing technical debt by Chris Willmott (codeHarbour April 2019)
Managing technical debt by Chris Willmott (codeHarbour April 2019)Managing technical debt by Chris Willmott (codeHarbour April 2019)
Managing technical debt by Chris Willmott (codeHarbour April 2019)
Alex Cachia
 
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
Alex Cachia
 

More from Alex Cachia (20)

Supporting IT by David Meares
Supporting IT by David MearesSupporting IT by David Meares
Supporting IT by David Meares
 
OWASP Top 10 2021 - let's take a closer look by Glenn Wilson
OWASP Top 10 2021 - let's take a closer look by Glenn WilsonOWASP Top 10 2021 - let's take a closer look by Glenn Wilson
OWASP Top 10 2021 - let's take a closer look by Glenn Wilson
 
If you think open source is not for you, think again by Jane Chakravorty
If you think open source is not for you, think again by Jane ChakravortyIf you think open source is not for you, think again by Jane Chakravorty
If you think open source is not for you, think again by Jane Chakravorty
 
Chaos Engineering – why we should all practice breaking things on purpose by ...
Chaos Engineering – why we should all practice breaking things on purpose by ...Chaos Engineering – why we should all practice breaking things on purpose by ...
Chaos Engineering – why we should all practice breaking things on purpose by ...
 
A brief overview of the history and practice of user experience by Ian Westbrook
A brief overview of the history and practice of user experience by Ian WestbrookA brief overview of the history and practice of user experience by Ian Westbrook
A brief overview of the history and practice of user experience by Ian Westbrook
 
Return the carriage, feed the line by Aaron Taylor
Return the carriage, feed the line by Aaron TaylorReturn the carriage, feed the line by Aaron Taylor
Return the carriage, feed the line by Aaron Taylor
 
Treating your career path and training like leveling up in games by Raymond C...
Treating your career path and training like leveling up in games by Raymond C...Treating your career path and training like leveling up in games by Raymond C...
Treating your career path and training like leveling up in games by Raymond C...
 
Digital forensics and giving evidence by Jonathan Haddock
Digital forensics and giving evidence by Jonathan Haddock Digital forensics and giving evidence by Jonathan Haddock
Digital forensics and giving evidence by Jonathan Haddock
 
Software Security by Glenn Wilson
Software Security by Glenn WilsonSoftware Security by Glenn Wilson
Software Security by Glenn Wilson
 
Data Preparation and the Importance of How Machines Learn by Rebecca Vickery
Data Preparation and the Importance of How Machines Learn by Rebecca VickeryData Preparation and the Importance of How Machines Learn by Rebecca Vickery
Data Preparation and the Importance of How Machines Learn by Rebecca Vickery
 
Why Rust? by Edd Barrett (codeHarbour December 2019)
Why Rust? by Edd Barrett (codeHarbour December 2019)Why Rust? by Edd Barrett (codeHarbour December 2019)
Why Rust? by Edd Barrett (codeHarbour December 2019)
 
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
Issue with tracking? Fail that build! by Steve Coppin-Smith (codeHarbour Nove...
 
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
Hack your voicemail with Javascript by Chris Willmott (codeHarbour October 2019)
 
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
Developing for Africa by Jonathan Haddock (codeHarbour October 2019)
 
Revving up with Reinforcement Learning by Ricardo Sueiras
Revving up with Reinforcement Learning by Ricardo SueirasRevving up with Reinforcement Learning by Ricardo Sueiras
Revving up with Reinforcement Learning by Ricardo Sueiras
 
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
Blockchain For Your Business by Kenneth Cox (codeHarbour July 2019)
 
Seeking Simplicity by Phil Nash (codeHarbour June 2019)
Seeking Simplicity by Phil Nash (codeHarbour June 2019)Seeking Simplicity by Phil Nash (codeHarbour June 2019)
Seeking Simplicity by Phil Nash (codeHarbour June 2019)
 
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
Sharing Data is Caring Data by Mark Terry (codeHarbour June 2019)
 
Managing technical debt by Chris Willmott (codeHarbour April 2019)
Managing technical debt by Chris Willmott (codeHarbour April 2019)Managing technical debt by Chris Willmott (codeHarbour April 2019)
Managing technical debt by Chris Willmott (codeHarbour April 2019)
 
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
Telephone Systems and Voice over IP by Bob Eager (codeHarbour April 2019)
 

Recently uploaded

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill Newland

  • 2. NO ONIONS, NO TIERS AN INTRODUCTION TO VERTICAL SLICE ARCHITECTURE DISCLAIMER This talk is not about microservices. Any resemblance to microservices living or departed are purely coincidental.
  • 3. Database Data Access Layer UI Layer Business Layer A BIT OF HISTORY • 3-Tier Architecture • N-Tier Architecture • Tight coupling between layers
  • 4. UI ONION ARCHITECTURE • Direction of dependency is towards the core • Interaction between layers is via interfaces • Reduces coupling • Implementation may change as long as interfaces remain the same • But a single change may still affect every layer Application Services Domain Services Domain Model Change
  • 5. WHY IS THIS A PROBLEM? • Changes affect multiple service objects • Increases the chances of merge conflicts • Harder to test • Increased complexity
  • 6. ‘MY BANK’ SCENARIO Customer Loan Application Loan application Check credit score Loan rejected Loan approved Transfer money Ok Not Ok
  • 7. customerService customerService accountService loanService customerEntity accountEntity loanEntity Apply for Loan Get Customer Data Get Customer Data Get Account Data Evaluate Loan Update Loan Book Approve Loan creditScorerService Get Credit Score Deposit Money Update Balance Update Customer Get Account Data Update Balance Application Service Domain Service Domain Model Update Customer Data
  • 8. WHAT’S THE ALTERNATIVE? • Stop thinking about separating layers • Stop think about objects • Start thinking about features • Axes of change UI Layer Business Layer Data Access Layer Database Open Account Balance Enquiry Loan Application
  • 9. Loan Application COLLAPSING THE MODEL Get Customer Data Evaluate Loan Loan Approved Get Credit Score Update Loan Book Get Account Data Update Balance Database Credit agency Apply for loan Success Loan Rejected Fail
  • 10. IN PRACTICE • Every user action has its own class • Keep it contained • Reuse is not your friend • Input – Process - Output Input Output Process • Synchronous Call • Response to an event • Promise • Values • Raise an event • Fulfils promise
  • 11. IT DOESN’T HAVE TO BE HOMOGONOUS UI Layer Business Layer Data Access Layer Database Balance Enquiry Transfer Money Loan Book Report Website Business Layer Repository No-SQL Db Balance Enquiry API Business Layer ORM Main Db Transfer Money BI Business Layer SQL Reporting Db Loan Book Report
  • 12. https://mybank.co.uk … … … … … … My Bank Bill Newland Money Transfer Input Process Output Loan Application Input Process Output Get Statement Input Process Output TASK-BASED USER INTERFACES Transfer Loan Statement
  • 14. WHAT’S THE ADVANTAGE? • Adding not changing • Distinct merges • Isolated testing • Simpler Validation Authentication Authorisation Rarely Used Feature Different Feature Another Feature Loan Application Get Statement Money Transfer Balance Enquiry Persistence
  • 17. class LoanApplication extends Handler { process(input: LoanApplicationInput): Output { super.process(input); const output = new LoanApplicationOutput { success = true }; return output; } } class LoanApplicationInput extends Input { accountNumber: string; amount: number; … } class LoanApplicationOutput extends Output { success: boolean }
  • 18. class LoanResponse implements IResponse { success: boolean } class LoanRequest implements IRequest<LoanResponse> { accountNumber : string; } @RequestHandler(LoanRequest) class HandlerTest implements IRequestHandler<LoanRequest, LoanResponse> { handle(value: LoanRequest): Promise<LoanResponse> { return Promise.resolve(new LoanResponse { success: true } } const mediator = new Mediator(); const r = new LoanRequest(); r.accountNumber = "AB-12345-96C"; const result = await mediator.send<LoanResponse>(r); // result.success = true Mediatr library: https://www.npmjs.com/package/mediatr-ts

Editor's Notes

  1. Time check: 2
  2. Time check: 3 minutes
  3. Time check: 5
  4. Time check: 7
  5. Time check: 9
  6. Time check: 11
  7. Time check: 13 Axes of change: Single Responsibility Principle (see SOLID) advocates that each component of a well-structured software system should have only one reason to change
  8. Time check: 15
  9. Time check: 17
  10. Time check: 20
  11. Time check: 22
  12. Time check: 24
  13. Time check: 27
  14. Time check: 30