Skip to content
0:00 / 0:00

#verticalslicearchitecture#cqrs#ddd

Vertical Slice Architecture - Jimmy Bogard

NDC Conferences

230K subscribers • 110 videos on Hallway • Conference channel

YouTube
  • Recommended by 4 people: 4 in engineering communities.
  • Presented by Jimmy Bogard, creator of MediatR and AutoMapper
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

49K views6 years ago4 recommendations

Software designSoftware architectureDesign patterns

Jimmy Bogard introduces Vertical Slice Architecture, explaining how to build systems around features rather than horizontal layers using CQRS and DDD.

Don't forget to check out our links below! ndcporto.com/ ndcconferences.com/ Moving from a layered architecture to a vertical slice architecture can be a bit daunting. We remove abstractions, complex structures, and focus building on the axis of change, then what's next? What new structures, patterns, and policies will need to be introduced in this style of architecture? How will we deal with common business functionality, and where do concepts like CQRS and DDD fit in? In this session, we'll introduce the idea of vertical slice architectures, and dive into the patterns, tools, and techniques used with slices. We'll also cover how you can fit vertical slices into different kinds of systems, from desktop, SPA, and normal MVC applications. Finally, we'll look at some of the new challenges that come with slices and layers, and how a different approach provides a much more maintainable end result.

Why it's here

4 people recommend this

What people say. Highly recommended as a must-watch talk on the benefits and implementation of Vertical Slice Architecture in .NET applications.

u/zaibufin r/dotnet • Recommends

On “Is it just me or most of these "popular" template on github just doesn't really make sense to me?”

I actually prefer vertical feature slices in a single project. Apis I build tend to be small to medium size so its very clean to just create feature slices for each part. I still use mediatr. It removes the need for abstractions before it makes sense to abstract something. With several tiers you always have to abstract first because of reference issues, with vertical slices you just abstract common code between handlers. Here is one example, not exactly how I do it but it gets the message through link to this video Here is one from Jimmy Bogard himself link to this video Another example with an API https://www.srinadimpalli.com/2021/05/vertical-slice-architecture-using-net5-cqrs-mediatr-ef-core-c/

u/CookingAppleBearin r/dotnet • Recommends

On “Most flexible way to query data from database”

Another area that might be worth looking into is the Vertical Slice Architecture. Essentially, instead of your classes representing horizontal concepts (like a ToDoRepository class dedicated to ALL actions that can happen against a ToDo), you start separating your code into vertical actions/business logic your app performs (like a CreateToDo class that only focuses on validation and creation of ToDos). There are tradeoffs, but this is the pattern I've been using the last 5 years and really enjoying the benifits, especially with things like MediatR, FluentValidation, etc. You no longer need repositories because EntityFramework *is* a repository AND unit of work pattern. So each new busine…

u/pdevito3in r/dotnet • Recommends

On “For web devs who prefer using a Vertical Slice Architecture, you can spin up a VSA web api in minutes using the new Wrapt release”

This is the video that initially piqued my interest and this refactoring example was really good as well

u/pdevito3in r/dotnet • Recommends

On “For web devs who prefer using a Vertical Slice Architecture, you can spin up a VSA web api in minutes using the new Wrapt release”

> zero code re-use, and... not writing any shared classes or functions? > Literally this architecture implies that you should re-write the whole service top to bottom for every feature. I say get rid of functions entirely, every function is a dependency! 😂 This isn’t true at all. The point is that it doesn’t *force* layering and code reuse prematurely. A **key** aspect of VSA is refactoring as you build and moving logic into your domain layer. Jimmy Bogard has a good talk on it here and a good refactoring example here

u/pdevito3in r/dotnet • Recommends

On “Architecture Knowledge Update”

Great talk on vertical slice architecture. Must watch IMHO link to this video

u/djProduct2015in r/dotnet • Recommends

On “Advice on design patterns”

All great comments. Jimmy Boggard has a few videos on the vertical slice architecture and how MediatR plays nicely with all of that. (He wrote MediatR & Automapper) FastEndpoints looks superb at first glance also. Not to oversimplify what they've accomplished...but in the context of MediatR and CQRS they've certainly captured the pattern (and a whole lot more). The idea being an endpoint = 1 handler in code, which is portable, testable in isolation, etc. A React front-end should play nicely with all of these approaches regardless. link to this video

u/djProduct2015in r/dotnet • Recommends

On “Blazor Webassembly without Backend”

…ection of other isolated apps/packages. This is a very useful approach to larger teams of devs working on larger projects. Although not Blazor-specific, Jimmy Bogart (Automapper/MediatR) has a ton of videos on these concepts (DNC conference). Check those out if you're interested in how this can work effectively for some larger-scale teams/apps. [video…

u/zaibufin r/dotnet • Recommends

On “Managing DbContext in EFCore6 (the right way)”

link to this video link to this video

u/kjbetzin r/dotnet • Mentions

On “Is logic in a Mediator Handler an Anti-Pattern?”

This should give you a good idea of what we're talking about. I believe he says it in this video / talk (if not I'm pretty sure it's said either in his other Vertical Slice videos or the refactoring talk), but the idea is that to start with you can put all your logic into the handler... very procedural. Then as you work through your app you might identify areas that could use some refactoring. Vertical Slice Architecture - Jimmy Bogard (NDC Porto 2020) Domain-Driven Refactoring - Jimmy Bogard (NDC London 2022)