Clean Architecture vs Vertical Slice Architecture

  Рет қаралды 10,462

Gui Ferreira

Gui Ferreira

Жыл бұрын

Vertical Slice Architecture vs Clean Architecture: Which one is the best for your project?
💎 Be a Patreon to get the source code: / gsferreira
🚨 KEY LINKS
🤝 Support me on Patreon (and get access to source code) here: / gsferreira
👋 HEY FRIEND
If you're new to my Channel, my name is Guilherme, but you can call me Gui if Portuguese pronunciation is not your thing.
I see myself as a Minimalist Software Craftsman. That says a lot of what I talk about here.
So, why this KZbin channel? To share with you to simplify your life as a Developer through knowledge, technology, and practices.
If you are into those things as I do, don't forget to subscribe for new videos.
🔗 GET IN TOUCH
LinkedIn: / gferreira
Twitter: / gsferreira
GitHub: github.com/gsferreira
Visit my blog: gsferreira.com
#softwarearchitecture #dotnet

Пікірлер: 31
@carlosbaptiste2062
@carlosbaptiste2062 Жыл бұрын
I appreciate this explanation and applaud your contributions to the software development community. Obrigado!
@gui.ferreira
@gui.ferreira Жыл бұрын
Thank you, Carlos! You are one of my first Patrons. Thank you for keeping me going 😉
@marna_li
@marna_li Жыл бұрын
I tend to combine these styles - you can still keeping the domain layer separate if you need to test or re-use. Since technically, you can split your monolithic application into slices by modules and then features. And when you need to make a module into its own microservice that would be quite easy. What is important when mixing is understanding the pros and cons - especially dependencies (what most developers have a problem with before discovering CA). And that requires you do get comfortable (or uncomfortable) with one or another before making the decision. The point is not to lock yourself in for the future.
@gui.ferreira
@gui.ferreira Жыл бұрын
I agree. Both styles have many aspects in common. For that reason, it's easier to morph one into the other.
@CodeOpinion
@CodeOpinion 10 ай бұрын
Well done. I would say however in terms of team experience, I would argue that VSA doesn't require less experience. The reason being is that you're more open ended to how you implement anything. If and with CA you're handcuffed or as I like to say "in a box" about how you implement within each layer, as they are already defined. As you mentioned at the beginning VSA can go sideways if everything is implemented differently, that kind of proves the point. It also doesn't imply you aren't using patterns. Arguably you're probably using many of the same patterns as CA. I'd say you need to be more aware and constantly looking at the system and how features are being developed. I don't suggest consistency for the sake of consistency but more-so that if you evolve over time, features over time are going to look different on how their implemented, and that's a good thing. Anyways, well done.
@gui.ferreira
@gui.ferreira 10 ай бұрын
My take is that it requires less experience to feel productive in adding features. Usually, in something such as CA, you will notice the impact of experience after some time. "Inconsistency" over time, sounds good to me as well. It's part of the benefit. My concern is "inconsistency" due to individual preferences or knowledge, to be honest. And thanks for the comment. I'm a long-time subscriber 😉
@huguesviens
@huguesviens 9 ай бұрын
We have ported very large application to clean architecture for the last few years and we love it. I had a look at the newer slice architecture but it did not found it was an improvement. Your video perfectly encapsulate why, thanks for the analysis :)
@gui.ferreira
@gui.ferreira 9 ай бұрын
Great to hear! Thank you 🙏
@TheEamonKeane
@TheEamonKeane 2 ай бұрын
What a great video Gui! Nice to see you here as well as on X
@gui.ferreira
@gui.ferreira 2 ай бұрын
Hey Eamon! I hope you are doing fine! Glad you liked it
@purintavilsup8863
@purintavilsup8863 Жыл бұрын
Thanks for explaining these two architectures. I have better understanding now.
@gui.ferreira
@gui.ferreira Жыл бұрын
Great to hear! Thanks 🙏
@Tamer_Ali
@Tamer_Ali Жыл бұрын
Thanks a lot Gui, you awesome. looking for more topics about them
@gui.ferreira
@gui.ferreira Жыл бұрын
Glad you like it!
@JohnMarsing
@JohnMarsing Жыл бұрын
I like VSA because it has less layers I have to wrap my head around. It would be nice if there was better tooling or templates to guide developers so that each slice would have a high degree of familiarity. Thanks for the video
@gui.ferreira
@gui.ferreira Жыл бұрын
Thanks for adding that! I like your idea but I'm that it would defeat part of the goal of VSA.
@korayenko
@korayenko 10 ай бұрын
When your code starts to raise events I think it would be harder to manage complexity in slices. I mean when your slice is CreatePayment and when your handler success, now you should also touch your order, warehouse, notification sub systems and the structuring of clean arc makes it easier to manage.
@gui.ferreira
@gui.ferreira 10 ай бұрын
The tricky part is when there are no clear boundaries between slices. And you are correct, events make that harder to manage.
@herewegotoday
@herewegotoday 2 ай бұрын
Would you say it's generally a good idea to start with VSA and as the application evolves and you see patterns, refactor into CA if needed?
@gui.ferreira
@gui.ferreira Ай бұрын
I believe that starting with VSA with CA in mind won't work. The idea of VSA is to accept that things will be different and the goal is to not get back to a feature that is working to support another.
@equaco
@equaco 10 ай бұрын
This would have been better with following a requests journey in the code.I have worked with both approaches, in the code example it kinda looks like its about folder and project structures,how many of them..But as you mentioned both of them can have different structures so it kind of blurs the point..Nice video, but its not very clear to me on first watch.
@gui.ferreira
@gui.ferreira 10 ай бұрын
Thanks for the feedback!
@AboutCleanCode
@AboutCleanCode Жыл бұрын
I understood that VSA has very strong focus on code being "packaged by feature" and that those vertical feature slices should be very independent but do you really think there should be no shared code at all? I didn't found a clear "definition" so far, did you? thx
@gui.ferreira
@gui.ferreira Жыл бұрын
It's not a hard line and ideally, you extract "real duplication". One common shared piece is the domain model when present. VSA is a "plastic" architecture. In my opinion, due to its approach, the end result will be extremely different depending on the developer's years of experience.
@nilsmach6399
@nilsmach6399 9 ай бұрын
You should read the Clean Architecture book by Robert C. Martin. Then you would know, that vertical slicing is an important part of Clean Architecture.
@gui.ferreira
@gui.ferreira 9 ай бұрын
@@nilsmach6399 kzbin.info/www/bejne/laqte4WkZ8SGfMksi=5IKfEhpYJzbxZNUl&t=252
@rcastillo8686
@rcastillo8686 28 күн бұрын
cant you create a shared folder where things like models or utils shared across features live?
@gui.ferreira
@gui.ferreira 16 күн бұрын
In Vertical Slices? If you find duplication, and the duplicated code shouldn't evolve separately, you can.
@mariosk2139
@mariosk2139 10 ай бұрын
VSA can be a mess if applied in large projects. The solution will result into a huge repo with unlayered, unstructured chunks of code which is hard to navigate or maintain (not talking from a hypothetical stand point. Been there/done that and it wasn't pretty). Additionally, VSA is avoiding setting real rules and teams are not always producing good results when 0 rules are defined :). My opinion: Just go with CleanArchitecture. If it starts getting complicated, this would be a good indication that you need to break into 2 separate solutions. This will result into one CleanArchitecture structure per feature (or if you prefer a modular monolith, just create fully isolated feature folders within the same solution)
@gui.ferreira
@gui.ferreira 10 ай бұрын
I would say the classic "It depends". Even CA can bring more complexity than needed.
@rtzzz9772
@rtzzz9772 10 ай бұрын
what a mess
Why I Don't Write Long Methods Anymore
10:34
Gui Ferreira
Рет қаралды 2,5 М.
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 39 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 24 МЛН
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 551 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 50 МЛН
Clean Architecture IS about Vertical Slicing, actually!
15:24
About Clean Code
Рет қаралды 33 М.
Coupling and Cohesion to Write BETTER C# CODE
17:19
Gui Ferreira
Рет қаралды 2,5 М.
What does larger scale software development look like?
24:15
Web Dev Cody
Рет қаралды 1,3 МЛН
The Principles of Clean Architecture by Uncle Bob Martin
1:13:24
NorfolkDevelopers
Рет қаралды 570 М.
Vertical Slice Architecture, not Layers!
46:24
CodeOpinion
Рет қаралды 116 М.
Fix Your Controllers By Refactoring To Minimal APIs
14:56
Milan Jovanović
Рет қаралды 35 М.
10 Tools EVERY Software Engineer Should Know
9:46
Gui Ferreira
Рет қаралды 8 М.
Tired of Layers? Vertical Slice Architecture to the rescue!
12:26
Coupling and Cohesion Explained
11:43
Gui Ferreira
Рет қаралды 3,4 М.
😱Хакер взломал зашифрованный ноутбук.
0:54
Последний Оплот Безопасности
Рет қаралды 742 М.
Samsung Galaxy Unpacked July 2024: Official Replay
1:8:53
Samsung
Рет қаралды 23 МЛН
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00