The Beginner's Guide to Clean Architecture

preview_player
Показать описание

Clean Architecture is a domain-centric approach to organizing a software system to separate the concerns of the various components. Making the system easier to understand and maintain. This video will cover the fundamentals of Clean Architecture. I'll walk you through the individual layers and what we should place inside. And I'll wrap up with a suggestion on how you can learn more.

Join my weekly .NET newsletter:

Read my Blog here:

Chapters
0:00 What is Clean Architecture?
4:51 Clean Architecture - the layers
7:13 Do you need CQRS?
11:12 Want to master Clean Architecture?
Рекомендации по теме
Комментарии
Автор

Finally a video about this topic that actually makes sense and not a 20 minutes long time-waste.

bondymagnomous
Автор

Thank you dear Milan. question about Models:

1- In [CommandHandlers] & [QueryHandlers] we have [Request Class] which is inherited from [IRequest].

2- [Commands & Queries] class play a role like DTO which are used by handler class as input parameter.

3- [Queries] return a model and generally shall be different from [Domain] classes. If it is identical to [Domain] class, we create similar class (DTO) but don't expose domain class to upper layer.

4- So far, we have classes (Like Model) for commands (input) & queries (input) & DTO (output).

5- Item 1~4 can be used in API project and API project can be execute in server.

6- But, Client is a different project and for sending/receiving data to/from API we need to have [Input Model] for command & query and get data in DTO format.

Question:

As mentioned above, is it suggested to define new command/query/DTO classes in different project (Not in Application/Infrastructure layers) to reference them to [Client] project so, we do not have to create extra and identical classes? Is it accepted?

To clarify my previous question:
Is it possible to create [Model] class (input and output) in separate class library and reference them to all other projects? In this way, [Command] class can inherit from [DTO+IRequest] together.

hadimazareei
Автор

Hi Milan, i watch your content from a long time and also like it. I have a request can you try to keep content as beginner friendly so that if we share videos to someone, even if he has no context he can learn it easily and quickly

akashrokade
Автор

Looking forward to talking more about the modular monolithic architecture

sunzhang-dv
Автор

thanks, even for Senior devs, this is a great refresher

Paul-uosv
Автор

Very good examples and great advice for good practices! You are a great teacher

ianisoprian
Автор

Amazing content, thank you for this playlist about Clean Architecture, DDD and related topic

adriencbl
Автор

simply the best! simple and to the point. Thank you

mikeutube
Автор

Very nice, like always. I'd agree with (at least one) comment that I saw asking for a mini app that implements all of this, because theory is nice, but seeing it actually in practice is even better. It doesn't have to have cqrs with mediatr or use a real db nor be a web app. It can just be a simple console app that fetches some data from in memory database. For example a library where you can list all the books or all the authors, you can add or remove books and/or authors. You can have some business rules like a book can't have more than 2 authors... I think it'd benefit the community a lot :)

ms
Автор

Thanks for this, Milan. Your content is always top-notch.

whatinthebloodyhell
Автор

An excellent explanation about clean architecture. 🙂

saddamhossaindotnet
Автор

I might be even more opinionated around what is allowed in the application layer, since I mostly like the functional core imperative shell version of clean architecture. That means that no side effect/ I/O is allowed when invoking methods outside the outer layers. Since I/O means unpredictability in the business logic this must be done carefully, since business logic should not depend on side effects while the outer shell can do so 👍

Mig
Автор

I'm truly fascinated by this topic, thanks to your excellent explanation. I aspire to reach your level of knowledge in the future.

andergarcia
Автор

as always.. you are awesome,
I wrote the following message before seeing the end of your video,
{
Is there any chance that we can see you create a mini system of your choice to show for your follow how the systems build in real world, how we should implement design principles, design patterns in the real world, how we do that after analysing the idea, how we convert it to diagram maybe, or to tasks using agile.. scrum or kanban, how to manage git effectively, how to publish it to azure or aws.. I know it's alot, if you'd like to do that.. make it on a paid platform and I'm sure most of your followers will participate
}
I wrote that before seeing the end of your video 😂
I hope two things about your course,
first it's starting from scratch or let us say for bignner not for the people how have master degree as you do here in YouTube,
second it's convert the subjects that I mentioned above.
thanks alot

ahmedh
Автор

Thank you for this video. I have bin trying to find out where the API should go in clean Architecture but no one was giving a straight forward answer has you did here. I just have one more thing for you to clear up. The UI(Angular, React, Blazor) should this also go in the Presentation layer?

KemTech
Автор

Thank you for providing valuable information in the .NET environment, Milan. I've been following you for some time now, but I'm in need of a mentor in Java. Do you happen to know anyone who could help?

cancurva
Автор

Could you make any quick step by step guide for mid level developer for better understand this idea without CQS or with repository unit of work and services DP..

AhadKhan-in
Автор

Hi Milan! I have a question for you. Let's say I have clustered postgresql server (1 - write node, 3 - read only access nodes). What would be my best strategy to implement some sort of load balancing on my database? Well I can do some custom singleton service which can provide me always next connection string, but will it be ok? I believe there is a better solution somewhere.
Btw, I am using EF core

stasnocap
Автор

Thanks! Repository abstraction, in my opinion, should be at the application layer. It has nothing to do with the core business logic

ЮраКосенко-ее
Автор

Hi Milan, I'm learning about EF core. But I don't know what is default loading in EF core, can you explain me about this?

vietquang