Design Patterns: Decorator

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

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

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

    Full list for this series:
    0. SOLID Design Patterns (start from here): th-cam.com/video/agkWYPUcLpg/w-d-xo.html
    1. Design Patterns: Command/Memento: th-cam.com/video/zRbHlDeon3E/w-d-xo.html
    2. Design Patterns: Strategy: th-cam.com/video/QZIvlny1Onk/w-d-xo.html
    3. Design Patterns: Template Method: th-cam.com/video/MfAvs0n9uMs/w-d-xo.html
    4. Design Patterns: Observer and Publish-Subscribe: th-cam.com/video/72bdaDl4KLM/w-d-xo.html
    5. Design Patterns: Singleton: th-cam.com/video/sbML3xFHRbI/w-d-xo.html
    6. Design Patterns: Factories: th-cam.com/video/JEk7B_GUErc/w-d-xo.html
    7. Design Patterns: Adapter and Façade: th-cam.com/video/XYa0rmRMZ1Q/w-d-xo.html
    8. Design Patterns: Decorator: th-cam.com/video/6PPMR0GWrZQ/w-d-xo.html

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

    The cost for the ExpressoShotDecorator should be Cost = decorator.Cost + .55M;

  • @bohdan-belei
    @bohdan-belei ปีที่แล้ว

    Clear and excellent explanation. Thanks!

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

    Hi, nice explanation, thanks for sharing this. In the next videos it would be great to also have an example how the client would use this.

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

    Why almost all of the videos about decorator pattern talks about coffe shop..of course bcos the book uses coffe shop as the example

  • @ozgurNY
    @ozgurNY 14 วันที่ผ่านมา

    JS has no types. It means, decorator pattern doesn't apply because all the abstraction for flexible design is available without interfaces or abstract base. That being said, how would author claim that if he knew decorator pattern, it would save lots of time etc in his JS project. This is nonsense

  • @chrisbubbles9850
    @chrisbubbles9850 7 ปีที่แล้ว +7

    nice info guy's but maybe next time get a maybe a diagram , or even some uml schematic .. just the code allone makes it hard to follow Judith Bishop did a nice book on the subject years ago "C# 3.0 Design Patterns" published by O'Reilly

    • @MuletTheGreat
      @MuletTheGreat 3 ปีที่แล้ว

      Hard disagree. Everybody else puts up Visio slides labelled A and B, while these two have a CONVERSATION and talk with their hands. It's brilliant, and easy to follow, for me at least.

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

    Hello!
    I've got one question. In the EspressoShotDecorator we stack up all the decorated coffe ingredients plus the espresso. But for the cost we just add .55 to our cost, without considering the decorated coffee cost. This way, the espresso shot is gonna cost 0+.55 I think....
    Or am i missing anything?
    Nice Tutorial by the way! Cheers!
    Antonio

    • @heathenmonk1249
      @heathenmonk1249 3 ปีที่แล้ว

      4 years late but whatever. The first instance of the coffee "BaseCoffee" has a price of 1.50, and when you decorate it with the espresso you add .55 to that, totaling 2.05. As far as I know you will always need an instance if ICoffee in order to create a espresso, so you can't just instanciate an espresso by itself.

    • @coderider3022
      @coderider3022 2 ปีที่แล้ว

      Yes like he said it’s an onion and each layer is changing the previous value.

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

    Guys, that's gonna mount to an ungodly amount of classes... @_@ I'm getting dizzy.

  • @jaimeogrady7602
    @jaimeogrady7602 5 ปีที่แล้ว

    Thanks, very well explained.

  • @zubetto85
    @zubetto85 6 ปีที่แล้ว

    In the example with espresso, it seems that we duplicate the Ingredients list each time we add a decorator (each decorator maintains its own list of ingredients which contains all previous strings plus a new one). Why we can't add to BaseCoffee class the List private field and public methods that allow us to add elements in and retrieve information from this list. In this manner it could be similar to the event system.
    In general, if I suppose that my object can be modified then I add the property which stores the list of applied modifiers and some method that iterates over this list to define a final state of the object.

  • @DanielRodriguez-ds2qs
    @DanielRodriguez-ds2qs 4 ปีที่แล้ว

    How is the coffe example a decorator example and not a composite?

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

    Thank you for the simple explanation on the decorator pattern :) that was very helpful

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

    Phil is very precise with words even on a casual statement. Robert has a tough time . Haha I've seen Phil correct Roberts statements at least a dozen times. but this is just friendly corrections. :). Best videos in the internet for Design patterns. 👍😎

    • @coderider3022
      @coderider3022 2 ปีที่แล้ว

      Yeh total clash but it works

  • @s_rox5042
    @s_rox5042 3 ปีที่แล้ว

    Subsystem for the particula functionality, in short

  • @sc5shout
    @sc5shout 3 ปีที่แล้ว

    Oh, ok, so the decorator pattern is something similar to the ECS

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

    I couldn't find the link to the design pattern playlist, could someone please link? Thank you!
    Edit: Found it th-cam.com/play/PLT2NrqLzZng3YMek58eVZVkBiW3NyVSef.html

  • @sangramghorpade9021
    @sangramghorpade9021 7 ปีที่แล้ว

    Very very nice design patterns series ... Very nice real life examples and explanation by Philip .. thanks for posting such informative vedio .. plz post more designs patterns vedio

  • @joshualord986
    @joshualord986 3 ปีที่แล้ว

    Fantastic video. Thank you!

  • @coderider3022
    @coderider3022 2 ปีที่แล้ว

    I like these 2 doing videos.

  • @rohitgalgali5512
    @rohitgalgali5512 7 ปีที่แล้ว

    It would be really helpful if you guys could make a video on Code to interface and unity framework(ioc) topics

  • @budoray
    @budoray 7 ปีที่แล้ว

    Because everyone decorates an onion. Facepalm.

  • @Saranwity
    @Saranwity 4 ปีที่แล้ว

    Thank you, very clear.

  • @ibrahimelkilani8508
    @ibrahimelkilani8508 7 ปีที่แล้ว

    I didn't understand fully

  • @kenichimori8533
    @kenichimori8533 7 ปีที่แล้ว

    Console Visualizing Data Transmission Portorate Bypass Polar Design Pattern
    if 0 else 0 function 0/00 Point Position Power 0^0/00 Omega
    Clock Signature ‰ Com Theta.