Vertical Slice Architecture: How Does it Compare to Clean Architecture | .NET Conf 2023

preview_player
Показать описание
Is Vertical Slice Architecture the next big thing or just as cool new kid?

Enterprise software development requires you to choose the right architecture. This session with Luke Parker will provide a realistic dive into Vertical Slice Architecture (VSA) with .NET; showcasing the potential shift from Clean Architecture (CA) to VSA.

You will learn the benefits and drawbacks of both Clean Architecture & VSA. We'll reflect on some changes to increase development speed, focusing on a modern Web API, utilising the latest C# features.

See Luke demonstrate how to architect an application that is maintainable and scalable. Utilising a template for faster development, you can get up and running very quickly if you know how!

Join us and get ahead of the curve, and be the one driving innovation in your .NET application.

#dotnet
Рекомендации по теме
Комментарии
Автор

Don't know which livestream service you guys were using but the screensharing was lagging quite a lot both in the beginning and in the end.

vivekkaushik
Автор

Great video Luke! I enjoyed the succinct explanations of each software architecture. I've been a big fan of Clean Architecture for a long time, but it doesn't work for all projects (especially technical projects (such as AI). As you mentioned, I see VSA as a tool in the toolbelt. It's helpful to be aware of it so that you can apply it when appropriate.

dandoescode
Автор

Nice to see a simple example without the unnecessary bloat of MediatR. Two things I would personally do different though (but yeah, opiniated :P )
1. I would keep the presentation layer out of the slices so you could substitute the UI without touching the slices.
2. I personally don't use mocks but a concept called embedded stubs to keep the test logic for infrastructure code close to the implementation. That is less brittle then setting up mocks in test classes in general and removes the need for interface types all over the place leading to less maintenance.

Another architecture style I generally use together with this is A-Frame Architecture (ref. James Shore). It's a way to keep logic and infra code decoupled by having the Application layer be a "Traffic Cop" between those layers instead of having vertical dependencies.

Timelog
Автор

VLA is good, but you should still keep strategy inside the Slices.I do it a bit different. I have 3 project. UI, Application And Domain. Each Project use Vertical Slices. The Domain layer use VSA for entity features (CRUD) and other very flat technical features. The application layer uses VSA for Aggregate slices (feature where multiple entities are uses). Its great for ViewModels en WebRequestModels. I use the Application layer to make a translation between the UI and the Domain layer. At the UI layer, i just call a Slice in the Application Layer that returns a ViewModel. The UI handles the ViewModel for the UI parts. This way, i can reference the Application Later to Any UI layer, the logic is the same, but the UI can be different.

Forshen
Автор

Luke Parker, thanks for a nice overview of these four architectures. Would you mind sharing the blogs that you mentioned at your intro?

sunefred
Автор

To pros of the VSA I would also add the ease of splitting it into the actual microservices if such necessity will arise (or is actually planned down the line).

ml_serenity
Автор

I know it's for keeping the demo project simple, but it would have been great to generate the resulting project into something that shows a better separation between the API and the Application layers. I know the idea is to show how everything can be simplified, but it turns moot because then it makes it look like it's another form of monolith and gives a false idea of what really is VSA.
Showing how the Application can be plugged into an API, a Worker Service (with messaging consumers, for example) or any other type of client app, would be a better exercise to display that it can be adapted to any real life project and would prevent some unrelated comments.
Other than that, nice talk and video. We need more VSA talks about how it improves over CA.

CesarDemi
Автор

Quite the talk! Audio could've been better but learned so much!

samwagnerssw
Автор

Software is messy because it's connected to a messy world. All of these (except spaghetti) look nice at first, until you realize that you can't just split things into nice even lines across the board. All I see here is a different folder structure. I've worked with VSA and it gets messy when the slices (esp. presentation) aren't uniform throughout your app.

markcooke
Автор

Correct me if I'm wrong, but being a monolith vs microservices is purely about how you deploy and host your application, isn't it? Not the architecture and scaffolding upon which those containers are built. The 'spaghetti' structure put forward in the beginning is more akin to n-tier architecture, no?

kingjustink
Автор

I've learned so much from your videos. Keep it up!

acodersjourney
Автор

Where can I find the project you showed?

yuberley
Автор

in 18:52 what is the start command used there?

RajeshRajendran-yiyt
Автор

N-tier requires physical separation between tiers, in the example case n-layer would be better suited.

ViniciuxMariano
Автор

Use DDD (Strategic + Tactical) to figure out Vertical Slices and then implement each slice using Clean Architecture, simple 🙂

afouadr
Автор

how does this clean architecture from Onion architecture?

dlsmcdevops
Автор

Reminds me of CQRS + Mediator Pattern, what's the difference?

ManInTheFridge
Автор

Giving that "Clean" architecture is absolutely stained shit, I don't think it's hard to be better.

IIARROWS
Автор

I love how microsoft dont use their own tools, IDE RIder rather then vS :)

AdeelRizvi
Автор

What tf is this?
"Architecture" is being misinterpreted to be "organisation". Moving code files into folders isn't architecture!!

Also, just by renaming UnitOfWork, Actor, Domain Entity or Service to something else doesn't mean you've come up with new architecture!

These patterns have been used in software for a long time, vertical slices is essentially what a microservice is!
All you've done is have multiple microservices like organisation of code files in the same WebAPI project. But they still have release dependencies on eachother.
If you used CQRS, you wouldn't have the so called "vertical slice" of "ReadTodo" in the same WebAPI project. So that you can deploy it seperately, scale separately etc.

Learn the existing architectures & design patterns thoroughly first before coming up with bullshit like this & clean architecture!!

AseemChiplonkar