SlideShare a Scribd company logo
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

PPTX
Real-world software design practices when developing ASP.NET web systems by B...
PDF
Single page applications with backbone js
PPTX
Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)
PDF
Best Practice In Software Development
PPTX
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
PPTX
Cucumber_Capybara
PPT
Learn spring at amc square learning
PDF
OSGi Community Event 2010 - VMware and SpringSource Projects on OSGi
Real-world software design practices when developing ASP.NET web systems by B...
Single page applications with backbone js
Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)
Best Practice In Software Development
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
Cucumber_Capybara
Learn spring at amc square learning
OSGi Community Event 2010 - VMware and SpringSource Projects on OSGi

What's hot (20)

PPTX
iOS Architectures
PPTX
Mvc framework
PPTX
iOS Architecture
PPTX
Microservice at a glance
PPTX
Mule ESB
PPTX
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
PPTX
Under the hood with Micro Focus' Developer Technology
PPTX
How it works under the hood with visual cobol
PPT
J2ee connector architecture
PPTX
A Gentle Introduction to Blazor
PPTX
Contract-Based Web Services API Deep Dive
PPTX
JEE: EJB & CDI v praxi
PPTX
BackboneJS
PPT
Introduction To CodeIgniter
PPTX
Integration Best Practices
PPTX
Enterprise beans
PPTX
CodeIgniter
PPTX
Client Object Model - SharePoint Extreme 2012
PDF
Getting Started with the NetBeans Platform
PDF
Pal gov.tutorial3.session7
iOS Architectures
Mvc framework
iOS Architecture
Microservice at a glance
Mule ESB
SharePoint Saturday Stockholm 2015 - Building Maintainable and Testable Share...
Under the hood with Micro Focus' Developer Technology
How it works under the hood with visual cobol
J2ee connector architecture
A Gentle Introduction to Blazor
Contract-Based Web Services API Deep Dive
JEE: EJB & CDI v praxi
BackboneJS
Introduction To CodeIgniter
Integration Best Practices
Enterprise beans
CodeIgniter
Client Object Model - SharePoint Extreme 2012
Getting Started with the NetBeans Platform
Pal gov.tutorial3.session7
Ad

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

PPTX
Software architecture patterns
PPT
]po[ Developers: Reporting, Indicators & Dashboards
PPTX
CQRS recipes or how to cook your architecture
PPT
J2 ee archi
PDF
Computer science
PDF
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
 
PPTX
Microservices: The Right Way
PDF
Wireless Wednesdays: Introduction to XControls
DOC
250755494-advertising-agency-management-system-1-doc.doc
PPT
]project-open[ Reporting & Indicators Options
PPT
]project-open[ Reporting & Indicators Options
PDF
Lightening Talk @Symfony Conference 2016
DOCX
Cs8494 software engineering
PPTX
Shut Up And Eat Your Veg
PPT
9. Distributed Systems Architecture.pptnnihi
PPTX
CQRS
PPT
Architecting for Change: An Agile Approach
PPT
Lec-13_EmergingTrend.ppt................
PDF
Js foo - Sept 8 upload
PPT
128692851-Introducing-Windows-Azure.ppt
Software architecture patterns
]po[ Developers: Reporting, Indicators & Dashboards
CQRS recipes or how to cook your architecture
J2 ee archi
Computer science
The NRB Group mainframe day 2021 - Containerisation on Z - Paul Pilotto - Seb...
 
Microservices: The Right Way
Wireless Wednesdays: Introduction to XControls
250755494-advertising-agency-management-system-1-doc.doc
]project-open[ Reporting & Indicators Options
]project-open[ Reporting & Indicators Options
Lightening Talk @Symfony Conference 2016
Cs8494 software engineering
Shut Up And Eat Your Veg
9. Distributed Systems Architecture.pptnnihi
CQRS
Architecting for Change: An Agile Approach
Lec-13_EmergingTrend.ppt................
Js foo - Sept 8 upload
128692851-Introducing-Windows-Azure.ppt
Ad

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Digital Strategies for Manufacturing Companies
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Transform Your Business with a Software ERP System
How to Migrate SBCGlobal Email to Yahoo Easily
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How Creative Agencies Leverage Project Management Software.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Navsoft: AI-Powered Business Solutions & Custom Software Development
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
2025 Textile ERP Trends: SAP, Odoo & Oracle
Upgrade and Innovation Strategies for SAP ERP Customers
Odoo Companies in India – Driving Business Transformation.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41

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