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

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

ความคิดเห็น • 84

  • @kmcdo
    @kmcdo ปีที่แล้ว +16

    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- ปีที่แล้ว +20

    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 2 หลายเดือนก่อน

      Were deleted?

    • @alan-
      @alan- 2 หลายเดือนก่อน

      @@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.

  • @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!

  • @nikolabosnjak9991
    @nikolabosnjak9991 ปีที่แล้ว

    Watched all videos so far, you got some skillz to transfer knowledge in a good way . Good job man! :)

  • @novaploca2080
    @novaploca2080 ปีที่แล้ว +5

    I have been really expecting and looking forward to this video. Thank you very much!!!

  • @TurgayTuerk
    @TurgayTuerk ปีที่แล้ว +1

    Thank you Amichai. Looking forward for Part 15.....

  • @ngocoder
    @ngocoder ปีที่แล้ว

    Great video Amichai! The sound of the video is a lot better.
    Looking forward to your video about validation.

  • @MrBan001
    @MrBan001 ปีที่แล้ว +1

    Would the repository also return an errorOr or would ith throw an exception? for example if the id doesn’t exist.

  • @timschmidt5469
    @timschmidt5469 ปีที่แล้ว +10

    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...

  • @mohammednhari1737
    @mohammednhari1737 ปีที่แล้ว

    Wow !! Good job thank you we learn lot from you

  • @Dimadiv
    @Dimadiv ปีที่แล้ว +4

    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 9 หลายเดือนก่อน

      @@jamesroot9777 Did you find out what the case is?

    • @jamesroot9777
      @jamesroot9777 9 หลายเดือนก่อน

      @@mohcinelaaroubi8671 He just creates a custom string, something along the lines of:
      $"Host_{Guid}"

    • @codingsavid6509
      @codingsavid6509 9 หลายเดือนก่อน

      @@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 ปีที่แล้ว +2

    6:45 How come the line numbers in the editorconfig are so strange?

  • @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)

  • @juke-duke
    @juke-duke ปีที่แล้ว +2

    Do you think you can make a GraphQL series with CA and DDD at some point aswell?

  • @sushilb7994
    @sushilb7994 ปีที่แล้ว +3

    Finally!!!!!!!!!! Much awaited video... Thank you Amichai!!!!!

  • @rohitshirgaonkar1982
    @rohitshirgaonkar1982 ปีที่แล้ว

    At 25:33 why and how did you create hostId.create, since hostId is value object and not a aggregate?

  • @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.

  • @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?

  • @ЯнеКателиев
    @ЯнеКателиев ปีที่แล้ว

    Very nice video, thanks.

  • @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.

  • @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?

  • @phobia4gow
    @phobia4gow ปีที่แล้ว +1

    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.

  • @davemasters
    @davemasters ปีที่แล้ว +1

    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.

  • @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). 🤔

  • @thexpand
    @thexpand ปีที่แล้ว +4

    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  ปีที่แล้ว +4

      Yup , it’s planned 👍🏼

    • @thexpand
      @thexpand ปีที่แล้ว

      @@amantinband Awesome, can't wait to see those! You create awesome content :)

  • @Mauriciog87
    @Mauriciog87 10 หลายเดือนก่อน

    Swagger it's not working on my project, it says "No operations defined in spec!", someone with same issue?

  • @matthewrossee
    @matthewrossee ปีที่แล้ว +1

    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?

  • @kylegivler8372
    @kylegivler8372 ปีที่แล้ว +1

    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.

  • @musazulu7013
    @musazulu7013 ปีที่แล้ว +1

    I Learn a lot from you, thank you very much for sharing.

  • @sirpeace_coding
    @sirpeace_coding 4 หลายเดือนก่อน

    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;
    ```

  • @יוניארליך-ע5פ
    @יוניארליך-ע5פ ปีที่แล้ว +1

    מלך

  • @DeejayWazzouille
    @DeejayWazzouille ปีที่แล้ว +1

    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

  • @suhutwadiyo
    @suhutwadiyo ปีที่แล้ว +4

    Amazing!!!

  • @hamedsalameh8155
    @hamedsalameh8155 ปีที่แล้ว

    Great video Amichai! thanks for sharing.
    Looking forward for more content

  • @pazzuto
    @pazzuto ปีที่แล้ว +5

    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 ปีที่แล้ว +1

      @@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

  • @Mauriciog87
    @Mauriciog87 ปีที่แล้ว

    I was waiting for this, and it worth it!!! Kudos Amichai 💪💪💪💪💪!!!!

  • @wvanlosser
    @wvanlosser ปีที่แล้ว

    Once again a great video! Thanks for all the work you put into providing this kind of 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.

  • @Beachjfb
    @Beachjfb ปีที่แล้ว

    Thank you so much for your amazing content.
    Did you plan of doing ddd with Minimal Api 7 ?.
    Thank you so much

  • @Yarkendar
    @Yarkendar ปีที่แล้ว +1

    Best ddd tutorials

  • @patrykk.4630
    @patrykk.4630 ปีที่แล้ว +1

    Yupi! Yay! Finally! 😀 Thank you, thank you, thank you 😅

  • @loko-muklisfatoni1665
    @loko-muklisfatoni1665 ปีที่แล้ว

    Thank you Amichai, great as always

  • @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?

  • @demmy424
    @demmy424 ปีที่แล้ว +1

    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?

  • @aehp2558
    @aehp2558 ปีที่แล้ว

    Thank you

  • @mindorinku
    @mindorinku ปีที่แล้ว

    Such great content. However, as always :)
    Waiting for new informative videos!

  • @babutschi
    @babutschi 5 หลายเดือนก่อน

    You are beautiful and talented.♥

  • @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.

  • @carmineos
    @carmineos ปีที่แล้ว

    🔥

  • @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.

  • @abdulfattah.hussein
    @abdulfattah.hussein 11 หลายเดือนก่อน

    any one has a source code or wrote the code by himself plz give me github link

  • @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.

  • @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?

  • @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
    );
    "

  • @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 ปีที่แล้ว +1

    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."

  • @TrOgaN_
    @TrOgaN_ 3 หลายเดือนก่อน

    DO NOT INSTALL STYLE COP, YOU CAN'T GET RID OF IT

  • @sandromagalli8587
    @sandromagalli8587 ปีที่แล้ว

    Hi, what do you think about event sourcing? Would it be usefull in this scenario or does it work best in b2b?