SlideShare a Scribd company logo
1 of 28
Vertical Slices in .NET
Bojan Veljanovski, CTO at HASELT
1
What is an user’s intent in software?
2
User Intent - Reads and Writes
- WRITE is a request modeled as COMMAND triggered via HTTP POST
- READ is a request modeled as QUERY triggered via HTTP GET
- Commands modify data
- Queries retrieve data
3
User Intent - CQRS
CQRS is a simple pattern,
writing and reading data is placed
in 2 separate classes which have single responsibility.
4
DISCLAIMER
Nope… there is no silver bullet.
5
What we are going to talk about
- Overview
- Horizontal vs. Vertical user stories
- Horizontal vs. Vertical slices
- Commands & Queries
- Feature folders
- DEMO code
- Summary
6
“Two“ starting points to build a system
- Horizontal first
- Vertical first
7
Horizontal vs. Vertical user stories
- Horizontal
- Story 1: Create the new DB Table for Users
- Story 2: Create the DAL to access the DB Users
- Story 3: Create the Users business layer code that references the DAL
- Story 4: Write the Users UI screen
- Vertical
- Story 1: User can register and provide username and password.
- Story 2: User can manage multiple addresses.
- Story 3: User can add additional contact fields (phone, email, etc).
- Story 4: User can subscribe to a subscription plan.
8
Horizontal vs. Vertical user stories
- Horizontal
- Implement the database layer for A, B and C
- Implement the business logic layer for A, B and C
- Implement the user interface for A, B and C
- Vertical
- Implement A from end to end
- Implement B from end to end
- Implement C from end to end 9
Horizontal slicing is not natural in agile
- Changes usually happen vertically
- You limit your application to the same horizontal
constraints for all features (regardless of the size and
complexity)
- ...and more
10
“Slicing” is a team organization thing too!
11
Vertical Slices over Horizontal Slices
- Horizontal slices is organization by technical layers.
- Vertical slices is organization by features (business requirements).
12
Vertical Slicing: The Stakeholder
Stakeholders talk and eat the cake in vertical slices.
They want one delicious piece at a time, not only the vanila part.
Why don't we structure our code vertically as well?
13
Horizontal Slices
14
Horizontal Slices (2)
15
Horizontal Slices (3)
16
Vertical Slices
17
Organization structure
18
19
20
Addressing cross-cutting concerns
- Loggers
- Validators
- Transactions
21
ASP.NET MVC - Feature Folders ViewEngine
22
ASP.NET MVC - Feature Folders ViewEngine
23
Slide intentionally blank...
24
Can it easily evolve to CQRS?
25
Can it easily evolve to SOA/Microservices?
26
SUMMARY: Characteristics of good Vertical Slices
- Code is structured primarily by feature, secondary by layer
- Have single responsibility (business-oriented)
- Encapsulated and decoupled from other slices
- Complexity and defects are isolated in each slice, instead of
each layer
- Increases developer’s understanding of each feature as a
whole
- Enables incremental releases of features
- Enables faster feedback loop 27
SUMMARY: Trade-offs and Challenges
- Complete mindset shift
- Developers must be all-round-shaped (back, front, middle, db, all)
- Now you have twice as many classes as before
28

More Related Content

What's hot

iOS Architectures
iOS ArchitecturesiOS Architectures
iOS ArchitecturesHung Hoang
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS ArchitectureJacky Lian
 
Microservice at a glance
Microservice at a glanceMicroservice at a glance
Microservice at a glanceKetan Ghumatkar
 
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...Edin Kapic
 
Under the hood with Micro Focus' Developer Technology
Under the hood with Micro Focus' Developer TechnologyUnder the hood with Micro Focus' Developer Technology
Under the hood with Micro Focus' Developer TechnologyMicro Focus
 
How it works under the hood with visual cobol
How it works under the hood with visual cobolHow it works under the hood with visual cobol
How it works under the hood with visual cobolMicro Focus
 
J2ee connector architecture
J2ee connector architectureJ2ee connector architecture
J2ee connector architectureSubhasis Nayak
 
Contract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep DiveContract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep DiveGabriel Michaud
 
JEE: EJB & CDI v praxi
JEE: EJB & CDI v praxiJEE: EJB & CDI v praxi
JEE: EJB & CDI v praxiJUGZA
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniterschwebbie
 
Integration Best Practices
Integration Best PracticesIntegration Best Practices
Integration Best PracticesGabriel Michaud
 
Enterprise beans
Enterprise beansEnterprise beans
Enterprise beansvpulec
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012daniel plocker
 
Getting Started with the NetBeans Platform
Getting Started with the NetBeans PlatformGetting Started with the NetBeans Platform
Getting Started with the NetBeans PlatformGeertjan Wielenga
 
Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Mustafa Jarrar
 

What's hot (20)

iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
 
Mvc framework
Mvc frameworkMvc framework
Mvc framework
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
 
Microservice at a glance
Microservice at a glanceMicroservice at a glance
Microservice at a glance
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
 
Under the hood with Micro Focus' Developer Technology
Under the hood with Micro Focus' Developer TechnologyUnder the hood with Micro Focus' Developer Technology
Under the hood with Micro Focus' Developer Technology
 
How it works under the hood with visual cobol
How it works under the hood with visual cobolHow it works under the hood with visual cobol
How it works under the hood with visual cobol
 
J2ee connector architecture
J2ee connector architectureJ2ee connector architecture
J2ee connector architecture
 
A Gentle Introduction to Blazor
A Gentle Introduction to BlazorA Gentle Introduction to Blazor
A Gentle Introduction to Blazor
 
Contract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep DiveContract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep Dive
 
JEE: EJB & CDI v praxi
JEE: EJB & CDI v praxiJEE: EJB & CDI v praxi
JEE: EJB & CDI v praxi
 
BackboneJS
BackboneJSBackboneJS
BackboneJS
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Integration Best Practices
Integration Best PracticesIntegration Best Practices
Integration Best Practices
 
Enterprise beans
Enterprise beansEnterprise beans
Enterprise beans
 
CodeIgniter
CodeIgniterCodeIgniter
CodeIgniter
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
Getting Started with the NetBeans Platform
Getting Started with the NetBeans PlatformGetting Started with the NetBeans Platform
Getting Started with the NetBeans Platform
 
Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7
 

Similar to Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG

Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patternsMd. Sadhan Sarker
 
]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & DashboardsKlaus Hofeditz
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureThomas Jaskula
 
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...NRB
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right WayDaniel Woods
 
Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsTeamstudio
 
]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators OptionsKlaus Hofeditz
 
]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators OptionsKlaus Hofeditz
 
Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016ProjectAcom
 
Cs8494 software engineering
Cs8494 software engineeringCs8494 software engineering
Cs8494 software engineeringdevid8
 
Shut Up And Eat Your Veg
Shut Up And Eat Your VegShut Up And Eat Your Veg
Shut Up And Eat Your VegGarth Gilmour
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachBen Stopford
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 uploadDebnath Sinha
 
128692851-Introducing-Windows-Azure.ppt
128692851-Introducing-Windows-Azure.ppt128692851-Introducing-Windows-Azure.ppt
128692851-Introducing-Windows-Azure.pptSaraNawghare
 
MicroServices, yet another architectural style?
MicroServices, yet another architectural style?MicroServices, yet another architectural style?
MicroServices, yet another architectural style?ACA IT-Solutions
 
Presentation 2315006 done
Presentation 2315006 donePresentation 2315006 done
Presentation 2315006 donedeepaktile
 
Design at Scale: A Storage Case Study
Design at Scale: A Storage Case StudyDesign at Scale: A Storage Case Study
Design at Scale: A Storage Case StudyDesignMap
 

Similar to Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG (20)

Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patterns
 
]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
 
J2 ee archi
J2 ee archiJ2 ee archi
J2 ee archi
 
Computer science
Computer scienceComputer science
Computer science
 
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 
Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControls
 
]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options
 
]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options
 
Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016
 
Cs8494 software engineering
Cs8494 software engineeringCs8494 software engineering
Cs8494 software engineering
 
Shut Up And Eat Your Veg
Shut Up And Eat Your VegShut Up And Eat Your Veg
Shut Up And Eat Your Veg
 
CQRS
CQRSCQRS
CQRS
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
128692851-Introducing-Windows-Azure.ppt
128692851-Introducing-Windows-Azure.ppt128692851-Introducing-Windows-Azure.ppt
128692851-Introducing-Windows-Azure.ppt
 
MicroServices, yet another architectural style?
MicroServices, yet another architectural style?MicroServices, yet another architectural style?
MicroServices, yet another architectural style?
 
Presentation 2315006 done
Presentation 2315006 donePresentation 2315006 done
Presentation 2315006 done
 
Design at Scale: A Storage Case Study
Design at Scale: A Storage Case StudyDesign at Scale: A Storage Case Study
Design at Scale: A Storage Case Study
 

Recently uploaded

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Recently uploaded (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG

  • 1. Vertical Slices in .NET Bojan Veljanovski, CTO at HASELT 1
  • 2. What is an user’s intent in software? 2
  • 3. User Intent - Reads and Writes - WRITE is a request modeled as COMMAND triggered via HTTP POST - READ is a request modeled as QUERY triggered via HTTP GET - Commands modify data - Queries retrieve data 3
  • 4. User Intent - CQRS CQRS is a simple pattern, writing and reading data is placed in 2 separate classes which have single responsibility. 4
  • 5. DISCLAIMER Nope… there is no silver bullet. 5
  • 6. What we are going to talk about - Overview - Horizontal vs. Vertical user stories - Horizontal vs. Vertical slices - Commands & Queries - Feature folders - DEMO code - Summary 6
  • 7. “Two“ starting points to build a system - Horizontal first - Vertical first 7
  • 8. Horizontal vs. Vertical user stories - Horizontal - Story 1: Create the new DB Table for Users - Story 2: Create the DAL to access the DB Users - Story 3: Create the Users business layer code that references the DAL - Story 4: Write the Users UI screen - Vertical - Story 1: User can register and provide username and password. - Story 2: User can manage multiple addresses. - Story 3: User can add additional contact fields (phone, email, etc). - Story 4: User can subscribe to a subscription plan. 8
  • 9. Horizontal vs. Vertical user stories - Horizontal - Implement the database layer for A, B and C - Implement the business logic layer for A, B and C - Implement the user interface for A, B and C - Vertical - Implement A from end to end - Implement B from end to end - Implement C from end to end 9
  • 10. Horizontal slicing is not natural in agile - Changes usually happen vertically - You limit your application to the same horizontal constraints for all features (regardless of the size and complexity) - ...and more 10
  • 11. “Slicing” is a team organization thing too! 11
  • 12. Vertical Slices over Horizontal Slices - Horizontal slices is organization by technical layers. - Vertical slices is organization by features (business requirements). 12
  • 13. Vertical Slicing: The Stakeholder Stakeholders talk and eat the cake in vertical slices. They want one delicious piece at a time, not only the vanila part. Why don't we structure our code vertically as well? 13
  • 19. 19
  • 20. 20
  • 21. Addressing cross-cutting concerns - Loggers - Validators - Transactions 21
  • 22. ASP.NET MVC - Feature Folders ViewEngine 22
  • 23. ASP.NET MVC - Feature Folders ViewEngine 23
  • 25. Can it easily evolve to CQRS? 25
  • 26. Can it easily evolve to SOA/Microservices? 26
  • 27. SUMMARY: Characteristics of good Vertical Slices - Code is structured primarily by feature, secondary by layer - Have single responsibility (business-oriented) - Encapsulated and decoupled from other slices - Complexity and defects are isolated in each slice, instead of each layer - Increases developer’s understanding of each feature as a whole - Enables incremental releases of features - Enables faster feedback loop 27
  • 28. SUMMARY: Trade-offs and Challenges - Complete mindset shift - Developers must be all-round-shaped (back, front, middle, db, all) - Now you have twice as many classes as before 28