The vertical slice architectural style is a relatively new way of architecting applications that has been gaining a lot of traction and popularity. In essence, it boils down to organizing your code in vertical slices instead of in the more traditional horizontal or concentric layers. It was envisioned with request-response style applications in mind, making it a great fit for web applications and APIs. In this course, you will learn what it is and how to implement it, from scratch. You'll learn how to enhance it with the mediator and chain of responsibility patterns, how the CQRS pattern fits in, how to add logging & metrics, how to deal with validation and domain events, how to secure it and more.
Welcome
What will you learn in this course?
Who is the course for and prerequisites
Section Introduction
Introducing Vertical Slice Architecture
A Few Truths About Software Architecture
Comparing Vertical Slice Architecture to Other Popular Styles
Introducing the Demo Scenario
A First Look at the Code, Project and Folder Structure
Should You Separate Your Code Across Different Projects?
Section Summary
Section Introduction
Deciding on a Feature Folder Structure
Implementing the SearchDestinations Slice
Design Improvements: Outer Model Mapping, Cancellation Support and Abstractions
Designing the Domain
Adding a Database
Implementing the GetItineraries Slice
Implementing the GetStops Slice
Improving Error Responses with the Problem Details RFC
Section Summary
Section Introduction
Introducing the REPR, Mediator & Chain of Responsibility Patterns
Mediator and Chain of Responsibility Pattern Implementations: MediatR
Adding MediatR to Our Project
Using MediatR in Our Slices
Design Improvement: Auto-registering Endpoints
Section Summary
Section Introduction
Leveraging MediatR Behaviours and Pipelines
Using an IRequestPreProcessor for Logging
Observability and Metrics
Using an IPipelineBehavior for Metrics
Handling Exceptions
Section Summary
Section Introduction
Vertical Slice Architecture and CQRS
Implementing the CreateStop Slice (a Command Slice)
Implementing Model Validation
Optimizing Query Slices for Reading Data
Looking Into the Different Levels of CQRS
Section Summary
Section Introduction
What Are Domain Events?
Supporting Domain Events
Approaches for Publishing Domain Events
Publishing Domain Events
Code Duplication Vs Abstraction
Reorganizing Code When Needed
Section Summary
Section Introduction
Authentication and Authorization for APIs
Requiring and Validating a Token
Generating a Token
The Case for a CurrentUserService, and Implementing It
Authorization Policies
Implementing a Feature-specific Authorization Policy
Implementing an Action-specific Authorization Policy
A Word of Caution on Using Tokens for Fine-grained Authorization
Section Summary
Section Introduction
Testability in Vertical Slice Architecture
Test Automation
Adding a Unit Test with xUnit
Improving Test Isolation with Moq
Getting Ready for Integration Testing
Writing an Integration Test
Pragmatism in Test Automation
Improving the Integration Test Infrastructure
Scalability in Vertical Slice Architecture
Section Summary
Course Info
Lifetime access
Add to Cart
Kevin is a freelance solution architect, author & consultant, living in Antwerp (Belgium). He started working in the IT sector over 20 years ago, and is an 11-time Microsoft MVP. He's focused on architecture & security for web applications & integration components, using .NET and Azure. He's a keen proponent of open-source software. Also: wine.
More courses by Kevin Dockx© 2023 Dometrain. All rights reserved.