Decorator Design Pattern | Low Level Design | OOPS | Java | Best Video to Understand

preview_player
Показать описание
0:00 - Real Life Use Case of Decorator Pattern
1:55 - Understanding Decorator Pattern from an OOPS Point of View
6:25 - Code Demonstration

Tags

#designpatterns #builderpattern #lld #oops #java
Рекомендации по теме
Комментарии
Автор

Great explanation !

For all confused about why use decorator at all, please see that the decorators do not have an existence by themselves and are useful only in conjunction with the main product. Instantiating cheese just by itself has no meaning, it is not a burger type, it is an add on. It has to have a burger instance for it to exist. That's why decorator class and the reason why this is a 'structural' pattern.

However, I do feel that the Builder pattern can be used by the client code to build the final add-on decorator product, and the 2 products - burger and add-on decorator can finally be processed. @rite2riddhi please comment on this question.

ShwetaKarolMinhas
Автор

Hi Riddhi, you are really great at explaining end to end in simple way... Please add other remaining design pattern videos as well. Thanks buddy.

sandeepsinghchauhan
Автор

Top notch explanation with great clarity. Thanks

adhrit
Автор

Great! helping me revising my OOP concepts as well as getting some insights on LLD and Design Patterns.

amitrajitdas
Автор

Same can also be done by Builder pattern. For eg: The builder would be part of the Burger abstract class and since TandooriBurger and ZingerBurger extend Burger, so they will also get the Builder.

girishgarg
Автор

Why do we need another abstract class birgerdecorator and not use the burger class itself ?

JayShah_._._
Автор

great explaination. Now I just feel like having a burger.

manishasingh-dehi
Автор

Not Cheese miyo, the explanation is butter

easward
Автор

ThankYou for this highly informative video. I have one question, Can you please tell why can't we use a Builder pattern here, to make the Burger with all extra toppings (where all different toppings implement an interface), and then appending / adding topping's description and cost with burger's description and cost with every topping added and then finally build the burger.

rajsrivastava
Автор

Please put more low level design videos

nallunallammai
Автор

great video ...pls cover more design patterns

rishav
Автор

Sir, are decorators always abstract? If it is festival time and we need to introduce some cost discounts, we can directly write the common function inside the decorator class instead of changing both cheese and mayonnaise classes.

nithinnarayanansaravanan
Автор

Please add more videos in this series .

deepalirathod
Автор

Didn't understand the use of Decorator abstract class here.. ExtraCheese class can also be the direct child of the Burger abstract class right? Am I missing something here 🤔

raghunadh_g
Автор

I want to eat zinger burger after watching this video.

mansinawani
Автор

Hi, great content & explanation, appreciate it. How can I get the code you wrote? could you share it?

hiteshza
Автор

Alternately, the Burger Decorator could keep a pointer to the Burger instance which would have been passed to it through it's constructor.
Anyway, both seem fine.

tuhinmukherjee
Автор

what is the point of adding this BurgerDecorator, can't we directly do this in the ExtraChesse Class?

lovleshbhatt
Автор

Do we actually need the decorator class, I mean we can simply extend burger class for with cheese and mayo?

neelanshgulati
Автор

Hey riddhi
One suggestion is that please speak slowly and apart from this everything is good.

sayankarmakar