Vertical Slice Architecture
summary
Shifts layered apps into per-feature code where each action is a request/handler/response class, registered with MediatR, using AutoMapper projections or raw SQL/EF Core/Dapper for reads and handlers that directly call infrastructure for writes. Adds pipeline behaviors for transactions, retries and logging, uses FluentValidation for request checks, pushes complex rules into domain objects, and relies on integration tests for handlers and unit tests for domain. Results: smaller merge conflict surface and more maintainable features.
AI-written summary · about
chapters (56)
- 0:00Vertical slice Architecture
- 2:54Traditional n-tier UI Layer
- 4:05Organizing by layer
- 5:51Areas of change
- 8:00Move code to single place
- 8:59Move service methods to classes
- 10:54Modeling requests
- 11:44Request/Response with Mediatr
- 13:20Registering Mediatr
- 13:52Commands and Queries
- 15:25One model in, one model out
- 16:23Complete encapsulation
- 16:58Modeling Queries
- 19:46Paging/Sorting/Filtering
- 20:13Modeling Responses
- 21:19Complex Response
- 23:32Command/Query Duality
- 24:39Modeling Commands
- 24:49Simple Commands public class Edit
- 26:33Model-Bound Types
- 27:30Task-Based UIS
- 28:54Modeling Command Responses
- 29:18void Response
- 30:03Success/Fail
- 30:33Creation
- 31:32Complete Response
- 35:16SQL Projections
- 35:52Encapsulated Logic
- 37:13Duplicate Logic
- 38:16Command Handlers
- 38:43Procedural Beginnings
- 38:57DI with no abstractions
- 41:19Code Smells
- 42:20Behavioral Smells
- 43:22Push Behavior Down
- 44:01Encapsulated Domain
- 45:15validation Scopes
- 46:17Request validation
- 46:57Domain validation
- 47:26Representations
- 47:39Controllers as routes
- 48:14Razor Pages
- 51:04Pipeline Behavior (Decorator)
- 51:24Stackable Decorators
- 51:44Think: Action Filters
- 52:12Transactions
- 53:00Unit of work
- 53:23Concurrency and Retries
- 54:10Logging
- 54:57Registration
- 57:07Setting Up Data
- 57:25Sending Requests
- 58:20Testing queries through result
- 59:00Setup through the front door
- 59:25Setup data directly when needed
- 59:41Test commands with roundtrips
related talks
26mSimplifying Our Code with Vertical Slice Architecture
40mSOLID Architecture in Slices not Layers
58mDesigning for change with Vertical Slice Architecture
54mDesigning for change with Vertical Slice Architecture
58mBuild software like a bag of marbles, not a castle of LEGO®
48mUnderstanding Feature-Sliced Design
42mStratified design and functional architecture
50mClean Architecture with ASP.NET Core 2.2
