Simplest Decorator Design Pattern in C#

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 52

  • @jtjnash
    @jtjnash 2 года назад +1

    I looked at several explanations before watching this. Yours finally made it simple and easy to understand. Thank you.

  • @hocahaenyi7685
    @hocahaenyi7685 2 года назад +2

    Great video!!
    It may help that we reuse the variable "pizza" and keep re-assigning it to each decorator instance. It makes it clearer that "one thing" is being transformed through decorations.
    IPizza pizza = new Pizza();
    pizza = new CheeseDecorator(pizza);
    pizza = new TomatoDecorator(pizza);
    pizza = new OnionDecorator(pizza);
    ....

  • @deepdarkguz9ka729
    @deepdarkguz9ka729 3 года назад +3

    It's very simple explanation, but also it's so useful, thanks for explanation!

  • @IAmESG
    @IAmESG 3 года назад +7

    Amazing video, would love to see more, though I suggest that you add a UML diagram in the future.

  • @cityrunner-x3x
    @cityrunner-x3x 3 года назад

    Finally Eminem explained it very well. Thanks alot.

  • @nandinik7816
    @nandinik7816 3 года назад

    This video gave the clear picture. Referring many sites didnt help me. Thanks a lot... Could you also provide videos on designing any architecture

  • @nascimentoalexandre
    @nascimentoalexandre 8 месяцев назад

    Man, you nailed it. If you can made me understand this, you're good at explanation! lol

  • @Oluciaano
    @Oluciaano 4 года назад +3

    the video was very good, it dealt with in a simple way, I missed UnitTest and how to do the injection depedency
    could you include these steps in the next videos?
    example using FluentAssertion.

  • @MrMattberry1
    @MrMattberry1 2 месяца назад

    Great video, I prefer the builder pattern

  • @AriLetsPlays
    @AriLetsPlays 2 года назад

    Thanks for making this easier to understand!

  • @charlesopuoro5295
    @charlesopuoro5295 Год назад

    Great Job. Thank you for this Charitable Endeavour.

  • @ahmedm_seada
    @ahmedm_seada Год назад

    thank you so much for this simple explanation.

  • @澳贼
    @澳贼 3 года назад

    nice and clean code, clear explanation. thanks.

  • @williamedstrom9575
    @williamedstrom9575 Год назад

    The simplicity is great for comprehension, but one question I still have is how to handle other methods not explicitly extended by the decorator.

  • @alreadytakenindeed
    @alreadytakenindeed 2 года назад

    Great and very clean video, thank you!

  • @Myrelaxedlife
    @Myrelaxedlife 2 года назад

    That's pretty good. Thanks for the explanation.

  • @applicationtest4680
    @applicationtest4680 4 года назад

    Best explanation ! I've never had before Thanks so much

  • @krin3x93
    @krin3x93 3 года назад +1

    Can I also re use the variable "pizza" instead of creating new variables with differenet names and passing them? So that I can only have one instance of pizza being upgraded until It got passed through all decorators?

    • @devemfoco
      @devemfoco 3 года назад

      I think the same: adding decorators to pizza. At the end, call a pizza type, then show all itens added.

    • @dietrevich
      @dietrevich 2 года назад

      No, he needs to called then for what they are, toppings. That way the references in the code are clearer and understandable. He can use "toppings" for all three and leave pizza as pizza which is what it is.

  • @DaveWalker_OakGames
    @DaveWalker_OakGames 3 года назад +1

    Quick and well explained, thanks!

  • @ivanfernandesgarcia6017
    @ivanfernandesgarcia6017 3 года назад

    Thanks for this video!

  • @prafulsinghvit
    @prafulsinghvit 3 года назад

    wow...what a nice pizza..!! I mean nice tutorial 😂. Keep it up ❤️

  • @sanelectro062
    @sanelectro062 4 года назад

    It was really simple.. Thank you

  • @vernonvandermerwe3270
    @vernonvandermerwe3270 4 года назад +2

    This was an amazing example, Thank you so much man!!!!

  • @kuumaaa
    @kuumaaa 3 года назад

    nice and simple :p

  • @luizalmeida1209
    @luizalmeida1209 4 года назад

    Wow, really clarified it to me, thanks!

  • @dietrevich
    @dietrevich 2 года назад

    Instead of calling each decorator reference by specific name, like onion decorator, cheese decorator, etc call them all "toppings" and that way you can interchange the order without having to change the references in their constructors.

  • @avonzo
    @avonzo 2 месяца назад

    This looks like inheritance. What if you want to "decorate" existing methods that you can't change?

  • @GergelyCsermely
    @GergelyCsermely 11 месяцев назад

    Thanks

  • @Chiramisudo
    @Chiramisudo 4 года назад

    What if I want to bundle that functionality into an Attribute so it's as simple as applying an Attribute to a Method and getting the functionality added?

    • @CodeRadiance
      @CodeRadiance  4 года назад

      Nice idea. Will have look into that.

    • @Chiramisudo
      @Chiramisudo 4 года назад

      @@CodeRadiance I look forward to seeing your results. 😉

    • @BB-Shorts_Edit
      @BB-Shorts_Edit 4 года назад

      @@CodeRadiance if you implemented with Attribute, plz share that video link

  • @orange_brat
    @orange_brat 3 года назад

    Great thanks

  • @yaolegoleynik
    @yaolegoleynik 4 года назад

    Thank you!

  • @BahawalTV
    @BahawalTV 4 года назад +1

    Good man.

  • @JonahDominguez
    @JonahDominguez 4 года назад

    lol i got a bit confused for a moment when you started talking about pizza. i thought it was some programming term i had never heard of

  • @SharunKumar
    @SharunKumar 2 года назад

    Damn it, now I am craving for pizza

  • @jimiwills
    @jimiwills 2 года назад +1

    ❤️🍕🧑‍💻

  • @sumitsharma5537
    @sumitsharma5537 2 года назад

    Lit!

  • @TiborKoroknai
    @TiborKoroknai 4 года назад +2

    Who puts the cheese on the bottom? :D

  • @spicymustard9066
    @spicymustard9066 16 дней назад

    Bro made head first design patterns book a video. Just get the book everyone

  • @bradleyr4451
    @bradleyr4451 3 года назад +1

    your first example spells decorator wrong

  • @vivekkaushik9508
    @vivekkaushik9508 2 года назад

    OOP is unnecessarily complicated. I haven't seen any real world implementation of most of these "patterns". Most devs either don't have time or expertise or even interest/enthusiasm to go around playing with objects. People just write code for work. OOP creates more problems than it promises to solve by creating more technical jargon.
    Composition > Inheritance. That's why JS wins.

    • @CodeRadiance
      @CodeRadiance  2 года назад

      Yeah js makes composition extremely easy to implement.