REST + DDD + CA + CQRS - When it all plays together | CA & DDD From Scratch | Part 14

  Рет қаралды 46,466

Amichai Mantinband

Amichai Mantinband

Күн бұрын

Пікірлер: 84
@kmcdo
@kmcdo 2 жыл бұрын
So happy to get a long-form video! I think you are doing a great mix of short and long vods. Not only are these super educational, but I find them super inspirational; I find myself digging up some old abandoned projects/ideas and breathing new life into them using some of the concepts you are highlighting. Keep em coming!
@amantinband
@amantinband 2 жыл бұрын
Such a fun comment to read. Thanks, Kyle 🙏🏼
@alan-
@alan- Жыл бұрын
Many discrepancies with the code from the last video... The last video the Menu.Create() method didn't have the MenuSections parameter, instead it did have parameters for the created & updated dates, which aren't here now., and the MenuSections.Create() method didn't have the MenuItems parameter, now it has. also the hostId is in a different place than before. I can only tell this by looking at where you're calling it; I don't have the benefit of seeing what your actual method now looks like. I've been following along since the beginning and now I've had to go back through videos to check where my code went wrong, but actually there are bits missing from the videos. Please, the continuity is important!!!
@EldenFiend
@EldenFiend 3 ай бұрын
Were deleted?
@alan-
@alan- 3 ай бұрын
@@EldenFiend Yes. For much better videos and course, go to @Milan Jovanovic's channel. His (first) course is utterly amazing, and there are zero continuity issues in the code. I cannot recommend it highly enough. It's DDD & CA, but done extremely well.
@TurgayTuerk
@TurgayTuerk 2 жыл бұрын
Thank you Amichai. Looking forward for Part 15.....
@timschmidt5469
@timschmidt5469 2 жыл бұрын
You are NOT talking too fast or too much. We have pause buttons :) Great video! Thanks!
@amantinband
@amantinband 2 жыл бұрын
Print screening this for my wife 😁
@serb1146
@serb1146 2 жыл бұрын
I just watch twice. Once in 0.75 speed, then 1 to 1. Pause btn is also widely used :)))) It reminds me my fav guitar player, when he's performing something fast, he can easily tune a bit his guitar as well. no jokes...
@ngocoder
@ngocoder 2 жыл бұрын
Great video Amichai! The sound of the video is a lot better. Looking forward to your video about validation.
@radeksendecki9922
@radeksendecki9922 2 жыл бұрын
Great video, one of the best explanations on the entire internet. Good paste, straight to the topic. Fantastic presentation of practical usage of DDD and CA. Love your work!
@Ladyhoat
@Ladyhoat Жыл бұрын
Watched all videos so far, you got some skillz to transfer knowledge in a good way . Good job man! :)
@sirpeace_coding
@sirpeace_coding 6 ай бұрын
32:00 Isn't it easier to add these basic mappings in the ValueObject classes? Then Mapster will do conversions by himself without additional configuration. E.g. something like this defined inside MenuId: ``` public static explicit operator Guid(MenuId menuId) => menuId.Value; ```
@Dimadiv
@Dimadiv 2 жыл бұрын
HostId and other id value objects in previous videos have had Guid Value. So, implementation of HostId.Create(string hostId) can be suggested to be [..] Guid.Parse(hostId) [..]. But in the sample request you're using "asdf" as the host id. How is it converted to Guid? Or maybe you have changed implementation of HostId to have string Value?
@jamesroot9777
@jamesroot9777 Жыл бұрын
Did you find out what the case is? Interested myself, can't wrap my head around it.
@mohcinelaaroubi8671
@mohcinelaaroubi8671 11 ай бұрын
@@jamesroot9777 Did you find out what the case is?
@jamesroot9777
@jamesroot9777 11 ай бұрын
@@mohcinelaaroubi8671 He just creates a custom string, something along the lines of: $"Host_{Guid}"
@codingsavid6509
@codingsavid6509 11 ай бұрын
@@mohcinelaaroubi8671 Did you find it? hahaha I can't tell where that .HostId.Create() comes from as if it was an Entity and not a ValueObject TT
@mohammednhari1737
@mohammednhari1737 2 жыл бұрын
Wow !! Good job thank you we learn lot from you
@novaploca2080
@novaploca2080 2 жыл бұрын
I have been really expecting and looking forward to this video. Thank you very much!!!
@pazzuto
@pazzuto 2 жыл бұрын
One of the reasons I moved away from Clean Architecture is the number of files in different locations. Jumping around just to make a simple change like adding a field to the domain entity is a pain! I went to Vertical Slices and I've never looked back - I now only have a "Core" project and a Web/Desktop/Mobile. I still try to keep DDD in mind, but I really stay away from technical layers.
@amantinband
@amantinband 2 жыл бұрын
That’s definitely a down side. Although it is a good way to avoid god files
@joseptempra3207
@joseptempra3207 2 жыл бұрын
@@amantinband thanks a lot for your valuable and awesome videos. It will be interesting a video about de Vertical Slice Architecture and your opinion about taht. It seems a more practical way to do things and as Eddie says, a new way to avoid the jumping between layers... Best wishes!
@ivanvincent7534
@ivanvincent7534 Жыл бұрын
The features propagate through the layers in this video series. So it’s not as challenging as a project organised by technical folders. Also is the jumping really that bad given we can F12
@sushilb7994
@sushilb7994 2 жыл бұрын
Finally!!!!!!!!!! Much awaited video... Thank you Amichai!!!!!
@krccmsitp2884
@krccmsitp2884 Жыл бұрын
6:45 How come the line numbers in the editorconfig are so strange?
@phobia4gow
@phobia4gow 2 жыл бұрын
Nice video, Amichai! Looking forward to watching the validation video (with the difference between domain validation and request validation).
@eirikr72
@eirikr72 Жыл бұрын
Great list of videos. One question, Why the infrastructure layer has references to the domain layer (28:56)? I thought this wasn't supposed to happen.
@steff.h
@steff.h 4 ай бұрын
It’s the other way around. The domain layer should have as few references to other layers as possible, protecting it from changes in other layers. E.g., this way you can change the database technology without touching (and breaking) the domain layer.
@thexpand
@thexpand 2 жыл бұрын
Are you planning on making a video about domain events and handling them with event handlers? It would be super helpful to have it explained in more depth. I've read the Microsoft docs on this, but it doesn't go into much detail, e.g. how does it work if you handle events after committing the transaction (i.e. with eventual consistency), how do you deal with making sure that the database is in a consistent state if one of the event handlers fails, etc. Do you think it could be part of the scope of this tutorial/series?
@amantinband
@amantinband 2 жыл бұрын
Yup , it’s planned 👍🏼
@thexpand
@thexpand 2 жыл бұрын
@@amantinband Awesome, can't wait to see those! You create awesome content :)
@juke-duke
@juke-duke 2 жыл бұрын
Do you think you can make a GraphQL series with CA and DDD at some point aswell?
@matthewcampbell3072
@matthewcampbell3072 8 ай бұрын
I am curious about how you might handle a scenario where (for instance), you had a very large list of dinnerIds. Would you really return that with your Menu aggregate in a response? How might this be approached? How exactly would this scale? Again, purely hypothetical (assume 100k entries)
@rohitshirgaonkar1982
@rohitshirgaonkar1982 Жыл бұрын
At 25:33 why and how did you create hostId.create, since hostId is value object and not a aggregate?
@mouradaissani8957
@mouradaissani8957 2 жыл бұрын
Great video thank you, will it be better or to conceder to add another mapping step between the domain models and the store/db entities types (ex: MenuMenuEntity) since the repos will actually work with another type of models witch are the Entities?
@amantinband
@amantinband 2 жыл бұрын
Thanks! Depends what you use for storage. We will use EF Core. The actual tables are already a custom mapping of the domain models. I don’t think it’s necessary to introduce another layer on top of that.
@ЯнеКателиев
@ЯнеКателиев 2 жыл бұрын
Very nice video, thanks.
@musazulu7013
@musazulu7013 2 жыл бұрын
I Learn a lot from you, thank you very much for sharing.
@davemasters
@davemasters 2 жыл бұрын
Another great video. I feel quite vindicated & re-assured actually, as I follow almost exactly the same structure as you. Looking forward to the EF core video!
@evgeniysir4220
@evgeniysir4220 Жыл бұрын
Prior to this video, worked through the code, but in this video encountered a problem with the lack of continuity of the code, what is done outside the video has significantly changed the structure of the units. Unfortunately I can not see the source code, as I can not transfer money through Patreon (blocked in my country of residence), also blocked all the payment cards (segregation by place of residence). 🤔
@MrBan001
@MrBan001 Жыл бұрын
Would the repository also return an errorOr or would ith throw an exception? for example if the id doesn’t exist.
@deadbluescreen3101
@deadbluescreen3101 Жыл бұрын
Is there any real, quantifiable and concrete advantages using MediatR adding this level of indirection to the API controller instead of just use a delegate that points to the UseCase method?
@kylegivler8372
@kylegivler8372 2 жыл бұрын
Thank you so much for sharing this video series. I have really learned so much. My only complaint is the amount of code edited off screen, at times it can make it a bit hard to follow.
@robertroxxor
@robertroxxor 2 жыл бұрын
Incredible video series. the wealth of information that you provide in this series is pure gold. Thanks man.
@yannistocreau3598
@yannistocreau3598 2 жыл бұрын
Thanks for this amazing tutorial ! Can you explain how you get Mapster to work with your Domain objects as they are not supposed to have a default parameterless constructor ? I get an error when trying this on my project, and I don't see you using ConstructWith or MapWith.
@samosimoncic5020
@samosimoncic5020 Жыл бұрын
thanks for amazing video. I am wondering why the mapper was not used for mapping domain model Menu instead of factory method. Do you have any special reason for this?
@suhutwadiyo
@suhutwadiyo 2 жыл бұрын
Amazing!!!
@amantinband
@amantinband 2 жыл бұрын
🫶
@Yarkendar
@Yarkendar 2 жыл бұрын
Best ddd tutorials
@Mauriciog87
@Mauriciog87 Жыл бұрын
Swagger it's not working on my project, it says "No operations defined in spec!", someone with same issue?
@matthewrossee
@matthewrossee 2 жыл бұрын
Hi! Are you going to add some sort of middleware in next videos to verify whether userId specified in request matches the id contained in JWT?
@יוניארליך-ע5פ
@יוניארליך-ע5פ 2 жыл бұрын
מלך
@hamedsalameh8155
@hamedsalameh8155 Жыл бұрын
Great video Amichai! thanks for sharing. Looking forward for more content
@tonAmiJory
@tonAmiJory Жыл бұрын
Thanks for your videos! On each, you give us new ideas to improve our code base, can't wait for the next ones! One thing, if you can help, we are still looking for the best approach of reloading an aggregate from database without exposing properties and without re-validating it.
@patrykk.4630
@patrykk.4630 2 жыл бұрын
Yupi! Yay! Finally! 😀 Thank you, thank you, thank you 😅
@amantinband
@amantinband 2 жыл бұрын
😂❤️
@wvanlosser
@wvanlosser 2 жыл бұрын
Once again a great video! Thanks for all the work you put into providing this kind of content.
@Beachjfb
@Beachjfb Жыл бұрын
Thank you so much for your amazing content. Did you plan of doing ddd with Minimal Api 7 ?. Thank you so much
@loko-muklisfatoni1665
@loko-muklisfatoni1665 2 жыл бұрын
Thank you Amichai, great as always
@DeejayWazzouille
@DeejayWazzouille 2 жыл бұрын
Hi ! Great content :) Already learn something after less than 5 minutes lol :) What tools do you use to highline thing on your screen ? I looked after it recently and I can't figure it out :) Keep teaching :D
@amantinband
@amantinband 2 жыл бұрын
Thanks! I use ZoomIt. More details here: aka.ms/ZoomIt
@aehp2558
@aehp2558 Жыл бұрын
Thank you
@Mauriciog87
@Mauriciog87 2 жыл бұрын
I was waiting for this, and it worth it!!! Kudos Amichai 💪💪💪💪💪!!!!
@demmy424
@demmy424 2 жыл бұрын
CQRS and return aggregate from command look strange. Not operation result like ID but full data. Where segregation?
@amantinband
@amantinband 2 жыл бұрын
That’s a common approach as well. What downside do you see by returning the aggregate?
@babutschi
@babutschi 7 ай бұрын
You are beautiful and talented.♥
@KarwanEssmat
@KarwanEssmat Жыл бұрын
Perfect Amichai, for more readable Category result, I want to share it with you " var subCategories = request.SubCategories.ConvertAll(sb => { var groups = sb.Groups.ConvertAll(g => Group.Create(g.Name, g.Description, g.IsActive) ); return SubCategory.Create(sb.Name, sb.Description, sb.IsActive, groups); }); var result = Category.Create( request.Name, request.Description, request.IsActive, subCategories ); "
@carmineos
@carmineos 2 жыл бұрын
🔥
@carloswinstonjavierllenas3117
@carloswinstonjavierllenas3117 2 жыл бұрын
I'll compare tomorrow what I did in a pet project (keep track of the FIFA World Cup) including connecting to a database. Let's see what I can do better. Thanks in advance.
@mindorinku
@mindorinku 2 жыл бұрын
Such great content. However, as always :) Waiting for new informative videos!
@luisandrade9054
@luisandrade9054 2 жыл бұрын
Really love your videos Amichai, can't wait for the next one. I've been replicated all you have done so far, I'm new using visual studio code so I wanted to know when you say copilot extension do you mean GitHub Copilot extension?
@amantinband
@amantinband 2 жыл бұрын
Yes 👍🏼
@steff.h
@steff.h 4 ай бұрын
Do the repository interfaces not really belong in the Domain layer rather than the Application layer? Of course, the Application layer must be able to reference the Domain layer. And I assume, the Domain layer should be able to fetch entities/aggregates/etc. from the database. However, if the repository interfaces are put in the Application layer, that is not possible, since it would create a circular dependency between projects, which will not build (for good reasons). Furthermore, really utilising the ubiquitous language to its fullest would entail naming the repositories with it (instead of calling them xxxRepository). This establishes even further that they belong in the Domain layer. Finally: “it's recommended that you define and place the repository interfaces in the domain model layer” (Microsoft Documentation) I really appreciate the video. This is not negative criticism.
@TrOgaN_
@TrOgaN_ 5 ай бұрын
DO NOT INSTALL STYLE COP, YOU CAN'T GET RID OF IT
@user-rp9iis1en6h
@user-rp9iis1en6h 2 жыл бұрын
I have seen a lot of tutorials say "I won't do it like this in actual production", I am eager to know how to do it in actual production. In a typical rest API application, how do you handle DTOs, business logic, and entities? where do u put your business logic, where do you link up between the entity and Dto layer? where do you place your validation? after all, how do you ensure SOLID? Can we get a complete package in one single video?
@PierreThierryKPH
@PierreThierryKPH Жыл бұрын
You seem to be defining an API with routes that are known in advance by the server AND the client, like "/hosts/{hostId}/menus". If that's indeed the case, you are making a very common mistake in our field by calling this REST. The REST architecture includes the HATEOAS principle, which is completely contradicted by this kind of tight coupling between the implementation of the server and the client API.
@ondrejdlesk9352
@ondrejdlesk9352 Жыл бұрын
Hi, could you please elaborate a bit more on this?
@PierreThierryKPH
@PierreThierryKPH Жыл бұрын
​@@ondrejdlesk9352 in a REST API, the client only knows one entry URI (it might be a few, but usually you only need one) and gather any following URI in the body of the responses.
@abdulfattah.hussein
@abdulfattah.hussein Жыл бұрын
any one has a source code or wrote the code by himself plz give me github link
@metlic5209
@metlic5209 2 жыл бұрын
I don't see why DDD is in the video title. This is about putting things by directories and using implicit objects construction. If you are going to implement feature DDD-way, then you focus on describing and implementing DOMAIN rules in the code by exploring real-life business processes. The better title for the video: "How to build overlayered CRUD to database."
@pmpjim
@pmpjim Жыл бұрын
Frankly, I don't like this approach, make things complex and the codes actually become poor readable and there are some weird terms like value objects, aggregates, commands, which are not natural like models, hierarchies, execute, query.... and also everything seems to be scattered into multiple layers, every layer has common..... this is personal opinion from a mainly Java guy, but thanks for sharing and I'll still be watching all the videos!
@sandromagalli8587
@sandromagalli8587 2 жыл бұрын
Hi, what do you think about event sourcing? Would it be usefull in this scenario or does it work best in b2b?
Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference
11:26
Confronting Ronaldo
00:21
MrBeast
Рет қаралды 33 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 63 МЛН
What's new in .NET 9 and C# 13
19:21
Filip Ekberg
Рет қаралды 18 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 7 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 77 М.
The Best Way To Organize Your Program.cs In ASP.NET
6:59
Amichai Mantinband
Рет қаралды 18 М.
How to start with DDD when you have a monolith - Javiera Laso - DDD Europe 2022
17:06
Domain-Driven Design Europe
Рет қаралды 12 М.
Getting Started with Dapper in .NET
11:29
Amichai Mantinband
Рет қаралды 14 М.
Using EF Core’s Coolest Feature to Audit in .NET
26:06
Nick Chapsas
Рет қаралды 39 М.