Clean Architecture with ASP.NET Core 8 | .NET Conf 2023

196,806
0
Published 2023-11-17
Clean Architecture (aka Onion, Hexagonal, Ports-and-Adapters) organizes your code in a way that limits its dependencies on infrastructure concerns. This results in much more testable, maintainable code and is ideal for Domain-Driven Design as well as microservices. Learn how to apply it to your ASP.NET Core apps!

Chapters:
00:00 Let's get started
00:06 What is Clean Architecture
01:25 When to use Clean Architecture
03:25 Two approaches to layered architecture
05:57 Demo
www.nuget.org/packages/Ardalis.CleanArchitecture.T…
07:25 Clean Architecture Rules
08:51 What belongs in the Core project
13:48 Demo
16:23 What about CQRS
16:45 What belongs in teh Use Cases project
17:01 Demo
18:35 What belongs in the Infrastructure project
20:02 Demo
21:29 What belongs in the Web project
22:05 Demo
23:57 The Shared Kernel
24:17 Demo
25:52 Resources
25:57 Q&A

Clean Architecture Template
github.com/ardalis/CleanArchitecture

eShopOnWeb Reference Application
github.com/dotnet-architecture/eShopOnWeb

Architect Modern Apps w/ASP.NET Core eBook
dotnet.microsoft.com/learn/web/aspnet-architecture

More from Steve
ardalis.com/

Download .NET 8 - aka.ms/get-dotnet-8
Hack Together - aka.ms/hacktogether/dotnet
Learn collection - aka.ms/learn-dotnet-8
.NET 8 Survey - aka.ms/dotnet-survey
Local Events - aka.ms/dotnetconf-local-event
Hero blog - aka.ms/dotnet8blog

Blog: aka.ms/dotnet/blog
Twitter: aka.ms/dotnet/twitter
TikTok: aka.ms/dotnet/tiktok
Mastodon: aka.ms/dotnet/mastodon
LinkedIn: aka.ms/dotnet/linkedin
Facebook: aka.ms/dotnet/facebook
Docs: learn.microsoft.com/dotnet
Forums: aka.ms/dotnet/forums
🙋‍♀️Q&A: aka.ms/dotnet-qa
👨‍🎓Microsoft Learn: aka.ms/learndotnet

#dotnet

All Comments (21)
  • @kenuahs
    I've read dozens of articles over the years on clean architecture, and a portion of those were tied in to .net apps, and this is by far the best presentation on clean architecture that I have seen! Was especially helpful to see a real-live project as well. Super well done presentation.
  • @chockshoway
    Great video Steve. Fantastic to see Microsoft finally talking about this, domains and DDD. Hopefully we'll see some domain-centric templates rather than those entrenching anti patterns like focus on the tech choice (MVC) and pushing teams towards procedural code (top level functions).
  • @fboucheros
    Amazing talk! Love it! Architecture is not an easy topic and you made it clear and approachable. I'll do a "donet new" to continue my exploration.
  • @mrohailiqbal
    It was a good learning experience through this video. Keep it up.
  • @bmassioui
    Thanks, Ardalis for this amazing presentation, which made the CA very simple and easy to comprehend. From my own perspective, I'd like to see those NuGet packages' code-base in the project, which will give them full control over them to maintain and adapt them based on the needs 👍
  • @acodersjourney
    Your channel is a treasure trove of knowledge. Thanks!
  • @FainTMako
    Great presentation. One of my favorites from this year!
  • @jan5310
    Just want to say thank you for your very good explained clean architecture presentation! Hopefully you can extend this presentation in a more indepth series. I am sure to be checking out your template and play with it.
  • @calvinwilson3617
    Love your template, I would argue that the biggest advantage of Clean Architecture aside from the dependency enforcements as you mentioned, is that you can easily swap out and configure the entire infrastructure layer. This can be extremely useful when you will have multiple clients/front ends. You can reuse the entire business logic and only create different implementations for the infrastructure layer. Most useful IMO for hosted Blazor WASM solutions although blazor itself still has a bit to go and can be frustrating to debug.
  • @rguere
    thanks so much. my project run ok..
  • @Jason_Shave
    Love this topic. I can tell you’re rushing through some of this content though due to the short session time constraints. Would be great to have more time on these topics and the same goes for most of the other content too.
  • @user-nw7jo5xw9x
    thanks for amazing presentation. Our team have ~10 micro-services on production with clean architecture.. and I personally don't recommend it.. The benefits of Clean Architecture are true, but not as big as we talk (for most case). However the downside of Clean Architecture are Bigger than we think.. Unfortunately not many peoples share the bad sides of Clean Architecture... My recommendation is Vertical Architecture. (If we could rewrite all our microservices again 😢)
  • @frankhoffy
    Great presentation Steve. Our agency had implemented something very similar in the past where we inverted the dependency between the business layer and the data access layer, so this seems like a logical progression for us. We're currently debating the virtues of a BFF layer too. I'm wondering if that will somehow factor into clean architecture in the future. The logic to combine data from multiple APIs needs to go somewhere after all.