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

  Рет қаралды 45,991

Amichai Mantinband

Amichai Mantinband

Күн бұрын

Пікірлер: 84
@kmcdo
@kmcdo Жыл бұрын
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 Жыл бұрын
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.
@novaploca2080
@novaploca2080 Жыл бұрын
I have been really expecting and looking forward to this video. Thank you very much!!!
@timschmidt5469
@timschmidt5469 Жыл бұрын
You are NOT talking too fast or too much. We have pause buttons :) Great video! Thanks!
@amantinband
@amantinband Жыл бұрын
Print screening this for my wife 😁
@serb1146
@serb1146 Жыл бұрын
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...
@radeksendecki9922
@radeksendecki9922 Жыл бұрын
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!
@ngocoder
@ngocoder Жыл бұрын
Great video Amichai! The sound of the video is a lot better. Looking forward to your video about validation.
@TurgayTuerk
@TurgayTuerk Жыл бұрын
Thank you Amichai. Looking forward for Part 15.....
@nikolabosnjak9991
@nikolabosnjak9991 Жыл бұрын
Watched all videos so far, you got some skillz to transfer knowledge in a good way . Good job man! :)
@sushilb7994
@sushilb7994 Жыл бұрын
Finally!!!!!!!!!! Much awaited video... Thank you Amichai!!!!!
@matthewcampbell3072
@matthewcampbell3072 7 ай бұрын
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)
@mouradaissani8957
@mouradaissani8957 Жыл бұрын
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 Жыл бұрын
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.
@mohammednhari1737
@mohammednhari1737 Жыл бұрын
Wow !! Good job thank you we learn lot from you
@Dimadiv
@Dimadiv Жыл бұрын
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 10 ай бұрын
@@jamesroot9777 Did you find out what the case is?
@jamesroot9777
@jamesroot9777 10 ай бұрын
@@mohcinelaaroubi8671 He just creates a custom string, something along the lines of: $"Host_{Guid}"
@codingsavid6509
@codingsavid6509 10 ай бұрын
@@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
@krccmsitp2884
@krccmsitp2884 Жыл бұрын
6:45 How come the line numbers in the editorconfig are so strange?
@juke-duke
@juke-duke Жыл бұрын
Do you think you can make a GraphQL series with CA and DDD at some point aswell?
@musazulu7013
@musazulu7013 Жыл бұрын
I Learn a lot from you, thank you very much for sharing.
@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?
@rohitshirgaonkar1982
@rohitshirgaonkar1982 Жыл бұрын
At 25:33 why and how did you create hostId.create, since hostId is value object and not a aggregate?
@phobia4gow
@phobia4gow Жыл бұрын
Nice video, Amichai! Looking forward to watching the validation video (with the difference between domain validation and request validation).
@robertroxxor
@robertroxxor Жыл бұрын
Incredible video series. the wealth of information that you provide in this series is pure gold. Thanks man.
@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?
@ЯнеКателиев
@ЯнеКателиев Жыл бұрын
Very nice video, thanks.
@suhutwadiyo
@suhutwadiyo Жыл бұрын
Amazing!!!
@amantinband
@amantinband Жыл бұрын
🫶
@patrykk.4630
@patrykk.4630 Жыл бұрын
Yupi! Yay! Finally! 😀 Thank you, thank you, thank you 😅
@amantinband
@amantinband Жыл бұрын
😂❤️
@davemasters
@davemasters Жыл бұрын
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!
@yannistocreau3598
@yannistocreau3598 Жыл бұрын
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.
@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 3 ай бұрын
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.
@wvanlosser
@wvanlosser Жыл бұрын
Once again a great video! Thanks for all the work you put into providing this kind of content.
@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). 🤔
@Mauriciog87
@Mauriciog87 Жыл бұрын
I was waiting for this, and it worth it!!! Kudos Amichai 💪💪💪💪💪!!!!
@יוניארליך-ע5פ
@יוניארליך-ע5פ Жыл бұрын
מלך
@hamedsalameh8155
@hamedsalameh8155 Жыл бұрын
Great video Amichai! thanks for sharing. Looking forward for more content
@loko-muklisfatoni1665
@loko-muklisfatoni1665 Жыл бұрын
Thank you Amichai, great as always
@sirpeace_coding
@sirpeace_coding 5 ай бұрын
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; ```
@Yarkendar
@Yarkendar Жыл бұрын
Best ddd tutorials
@thexpand
@thexpand Жыл бұрын
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 Жыл бұрын
Yup , it’s planned 👍🏼
@thexpand
@thexpand Жыл бұрын
@@amantinband Awesome, can't wait to see those! You create awesome content :)
@kylegivler8372
@kylegivler8372 Жыл бұрын
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.
@Mauriciog87
@Mauriciog87 11 ай бұрын
Swagger it's not working on my project, it says "No operations defined in spec!", someone with same issue?
@pazzuto
@pazzuto Жыл бұрын
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 Жыл бұрын
That’s definitely a down side. Although it is a good way to avoid god files
@joseptempra3207
@joseptempra3207 Жыл бұрын
@@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
@matthewrossee
@matthewrossee Жыл бұрын
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?
@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.
@DeejayWazzouille
@DeejayWazzouille Жыл бұрын
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 Жыл бұрын
Thanks! I use ZoomIt. More details here: aka.ms/ZoomIt
@Beachjfb
@Beachjfb Жыл бұрын
Thank you so much for your amazing content. Did you plan of doing ddd with Minimal Api 7 ?. Thank you so much
@luisandrade9054
@luisandrade9054 Жыл бұрын
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 Жыл бұрын
Yes 👍🏼
@demmy424
@demmy424 Жыл бұрын
CQRS and return aggregate from command look strange. Not operation result like ID but full data. Where segregation?
@amantinband
@amantinband Жыл бұрын
That’s a common approach as well. What downside do you see by returning the aggregate?
@babutschi
@babutschi 6 ай бұрын
You are beautiful and talented.♥
@mindorinku
@mindorinku Жыл бұрын
Such great content. However, as always :) Waiting for new informative videos!
@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 ); "
@steff.h
@steff.h 3 ай бұрын
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.
@aehp2558
@aehp2558 Жыл бұрын
Thank you
@carmineos
@carmineos Жыл бұрын
🔥
@TrOgaN_
@TrOgaN_ 4 ай бұрын
DO NOT INSTALL STYLE COP, YOU CAN'T GET RID OF IT
@carloswinstonjavierllenas3117
@carloswinstonjavierllenas3117 Жыл бұрын
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.
@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 11 ай бұрын
any one has a source code or wrote the code by himself plz give me github link
@user-rp9iis1en6h
@user-rp9iis1en6h Жыл бұрын
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?
@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!
@metlic5209
@metlic5209 Жыл бұрын
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."
@sandromagalli8587
@sandromagalli8587 Жыл бұрын
Hi, what do you think about event sourcing? Would it be usefull in this scenario or does it work best in b2b?
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 103 МЛН
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 11 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 63 МЛН
Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference
11:26
How to Create a Second Brain with Obsidian and Fabric
10:41
Dan Gauerke
Рет қаралды 13 М.
CQRS Doesn't Have To Be Complicated | Clean Architecture, .NET 6
24:09
Milan Jovanović
Рет қаралды 114 М.
The Best Way To Organize Your Program.cs In ASP.NET
6:59
Amichai Mantinband
Рет қаралды 17 М.
One CPU To Rule Them All - Ryzen 7 9800X3D Review
12:47
Linus Tech Tips
Рет қаралды 1 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 103 МЛН