Тёмный

Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference 

Amichai Mantinband
Подписаться 47 тыс.
Просмотров 30 тыс.
50% 1

In todays video, we'll talk about CA vs DDD.
Although they are often used together, they are actually completely different things. In this video we'll break down what the Clean architecture is, what Domain-Driven Design is, and what is the difference between them.
Connect with me on 'em socials:
Twitter: / amantinband
LinkedIn: / amantinband
GitHub: github.com/amantinband
Check out all my courses on DomeTrain:
dometrain.com/author/amichai-...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻

Наука

Опубликовано:

 

24 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@kmcdo
@kmcdo 4 месяца назад
you've been engagement'd! Loving the fresh vods lately - keep 'em coming!
@FalcoSparverius
@FalcoSparverius 4 месяца назад
Good way to start the week, thanks so much!
@Codewrinkles
@Codewrinkles 4 месяца назад
This was one of the key points in my latest video too. This common misunderstanding is very widespread and one of the major reasons why people tend to struggle with understanding software architecture in general.
@yevvgor
@yevvgor 4 месяца назад
Thanks! Crystal clear.
@MehediHasan-xd6rj
@MehediHasan-xd6rj 4 месяца назад
Many thanks for the video and expecting more :)
@ferventurart
@ferventurart 4 месяца назад
Hey Amichai thanks for your explanation it is clear!
@MrJonnis13
@MrJonnis13 4 месяца назад
Excellent video indeed.
@islamelgaidi1821
@islamelgaidi1821 4 месяца назад
Thanks for the video
@ylazerson
@ylazerson 4 месяца назад
Great video - thanks!
@nirajchandrajoshi
@nirajchandrajoshi 4 месяца назад
Great content I found today
@tanglesites
@tanglesites 4 месяца назад
I really like these videos because Amichai talks about the more advanced concepts that are not covered anywhere else on the internet. Because in todays market of developers, you are not getting hired with your typical self-taught You-Tube education. Your projects are going to need some complexity to showcase that you are not just some code-monkey, or react-andy. Before these videos I could not map a domain to schema, or had any idea on to create a domain to begin with. I feel like I had that level of professionalism to my projects needed to get noticed by employers. I think the only thing I have not seen on the internet is how domain events are implemented together with something like Mass Transit or RabbitMQ. Excellent explanation of how separation of concerns synergizes with battle tested patterns and architectural principals to produce quality code.
@mateuszmazurczak1268
@mateuszmazurczak1268 18 дней назад
Awesome work and material! I've got some feedback on things that may be misleading in the video: The DDD book (that picture you put in the video) does not speak about event-storming or any tooling to do the domain design itself. The layers shouldn't call outwards (as you showed on application layer), they should only call inwards. So that domain can't call application, application can't call presentation... "Business logic" that you mention speaking about the domain layer is a bit cryptic, as it's not only about logic and "business" word is also not on point since what database you choose, how you call your database etc. at the end is also part of the business. There may be a point in your design (especially at the beginning, but depends on the problem you are trying to solve) that indeed it is a detail, but all of that is part of the business. The more important part is that through design you are able to better decide what can be postponed and what needs to be done right now. So the "domain" layer is more about separating what's the language and concepts that stakeholders use (experts, business people, devs..) and separating it from technical decisions and other parts of the codebase. And here we could say that calling a database is separate from that language, although it's part of that business, but it's a part we don't need to exchange. They won't care if we use postgress or datomic and we do a query with that and that syntax, it's not something worth communicating over. Even though it is part of our business as it can affect performance, security of the data and so on. So in short: Clean/Onion/Ports&Adapters/Hexagonal/Layerd Architecture (so many names...) is just a type of software architecture, structuring of the code and its relations that is advised to use with DDD as it helps separate the domain DDD is about bringing all stakeholders (business people, developers, designers, experts...) to talk together and plan the software that is going to be made, which should result in code reflecting better it's intent, reducing misalignment between "business people" requirements and technical teams and enable better cooperation for future (easier applying changes, easier to exchange on topics, more accurate estimations...)
@ono48
@ono48 Месяц назад
Clear as mud!
@ransandu
@ransandu 4 месяца назад
Agreed what you just said. Also, it's required to understand that DDD != CA. I have seen people claim they have done DDD because they have implemented CA. Which is wrong. DDD can be used to model your problem domain but it should not influence CA. A tactical design decision tree can be used to identify business logic patterns and architecture patterns based on the subdomain identified (supporting, generic, and core)
@danielolajumoke4389
@danielolajumoke4389 4 месяца назад
God bless your heart Amichai. Struggled with the relationship between both concepts for quite a while now
@user-zg7gy6dh2y
@user-zg7gy6dh2y 4 месяца назад
Thanks for your videos, Amichai. My question will sound very specific but who knows... In my industry, experts are referring to real-world objects as "manufacturable" and "manufactured". But the current codebase refers to the corresponding entities as "manufacturableMachine" and "manufacturedMachine". Is there any recommendation on using either language in the codebase? The actual spoken terms, or more formal terms? Or if there is any kind of standard regarding this question, is it bothersome that the words used to refer to these entities are adjectives or past participles?
@knightmarerip711
@knightmarerip711 4 месяца назад
Really good vid. However, I kinda got confused when you started talking about the Application layer. Why do you have the application layer talking to the Infra layer? I thought the application layer can only communicate with the domain layer.
@Moosa_Says
@Moosa_Says 4 месяца назад
it would be really good if you can show an example project.
@amantinband
@amantinband 4 месяца назад
What specifically would you like to see?
@Moosa_Says
@Moosa_Says 4 месяца назад
@@amantinband maybe an example project of bank where each module is divided in it's own layer as you explained. where will be the UI, where will go the validations, models, business logic and where will be the db access layer etc..
@amantinband
@amantinband 4 месяца назад
I did something similar in this video, check it out - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1OLSE6tX71Y.htmlsi=k7Xh-tnPnGHWTJz3
@unhandledexception1948
@unhandledexception1948 2 месяца назад
from your courses would u suggest viewing the DDD before the Clean Architecture?
@techandstream
@techandstream 4 месяца назад
thank
@richaaa_.m
@richaaa_.m 4 месяца назад
hi, is the content of the video included in one of your dometrain courses? thanks!
@amantinband
@amantinband 4 месяца назад
Hey, I don't have a section that covers specifically the difference between the two (maybe that's a good idea for future courses). I have in depth courses on both CA and DDD so I would like to believe that viewers would know the difference, but maybe a dedicated sub-section is a good idea for the future
@AlfredNing
@AlfredNing 4 месяца назад
Can you issue a video code to realize the use of the warehouse layer and factory?
@serb1146
@serb1146 4 месяца назад
May we say that DDD, is when you develop little framework before for the specific application?
@thijsvandervegt3377
@thijsvandervegt3377 4 месяца назад
Hey Amichai, would it be possible to share the figma files/link for the diagrams/designs you've used in your CA-template? That way we could make similar diagrams for our projects, or update the ones you've used.
@amantinband
@amantinband 4 месяца назад
Answered on GitHub, but will drop the link to the figma communite plugin here as well for anyone coming across this comment: www.figma.com/community/file/1334042945934670571/clean-architecture-project-file-system
@RogerValor
@RogerValor Месяц назад
I feel like this is always explained a bit differently, as originally, the domain layer would contain all interfaces and definitions, and the application layer would implement them in the usecases. so strictly speaking the business "code" is in the application, while the domain only describes, but has no logic, however sets the domain language.
@evilpapagali
@evilpapagali 4 месяца назад
I just don't get why Infrastructure arrow is not from application to infrastructure. If Databases are in infrastructure, wouldn't the application be the one who's calling the infrastructure?
@evilpapagali
@evilpapagali 4 месяца назад
Researching more about the matter, the arrows are not calling process, but dependency. For implementation, Application layer could just call interfaces. Infrastructure implements those interfaces and then actually store and read data from DB.
@kqvanity
@kqvanity 23 дня назад
3:31 to the core layer rather?
@marrowfreeze
@marrowfreeze 4 месяца назад
You can’t make me understand. I refuse to
@shedrachelurihu4883
@shedrachelurihu4883 4 месяца назад
😂you just have to
@zhaltys
@zhaltys 3 месяца назад
From CA i am not sure that domain layer should contain logic, why is it not in application layer? as part of orchestration. In my experience, domain layer mostly contains domain entities, some constants and hmm maybe some exceptions
@achrefnabil2463
@achrefnabil2463 4 месяца назад
Can you please bro do a typescript clean architecture DDD course ❤
@Linkario86
@Linkario86 4 месяца назад
It's the same principles, just using Typescript?
@amantinband
@amantinband 4 месяца назад
DDD is language agnostic, and the course would be very similar. The Clean Architecture part would be implemented differently, using different libraries and tools, but would also look very similar. Maybe in general I do think it is a good idea to port the courses to other languages as well to help viewers understand the content in their preferred language, but don't think I'll have time for it in the foreseeable future
@Linkario86
@Linkario86 4 месяца назад
Hey Amichai, What do you think about the idea of using Clean Architecture for Modules in a Modular Monolith? On a first glimpse it seems like a good idea, especially since the Data Access can often get messy and Data Access across different Modules is made. With one Infrastructure layer, that wouldn't seem so wrong and confusing.
@amantinband
@amantinband 4 месяца назад
Using CA with modular monoliths is very common. Regrading infra, most solutions create an infra layer per module. Shared resources would be extracted to a common project if needed, but each of the modules would have it's own ifra layer
@Linkario86
@Linkario86 4 месяца назад
@@amantinband thank you! The common project is a good idea. In fhe data access we have a lot of cases where many Databases are joined together in each modules data access. That's why I was thinking of one Infra
@maroquio
@maroquio 12 дней назад
Hello, Amichai. Do you have a special discount for a poor public school teacher from Brazil? 😊
@dave_s_vids
@dave_s_vids 4 месяца назад
Great video, thanks... Smash the like button... I don't suppose you're a badminton player are you? ;)
@amantinband
@amantinband 4 месяца назад
Not at all 😂
@dave_s_vids
@dave_s_vids 4 месяца назад
@@amantinband :D I ask because it's a catchphrase from a badminton channel I watch ;)
@sheilahbeschorner5309
@sheilahbeschorner5309 4 месяца назад
*PromoSM* 😈
Далее
Turning trash into triumph, one can at a time!
00:18
Просмотров 2,3 млн
Exceptions are evil. This is what I do instead.
24:41
This BIG Modeling Mistake Is Ruining Your Performance
12:31
Domain Driven Design: What You Need To Know
8:42
Просмотров 98 тыс.
Vertical Slice Architecture, not Layers!
46:24
Просмотров 114 тыс.
DDD Building Blocks
4:27
Просмотров 31 тыс.
Will the battery emit smoke if it rotates rapidly?
0:11
Неразрушаемый смартфон
1:00
Просмотров 1,6 млн