No video

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

  Рет қаралды 6,739

Riddhi Dutta

Riddhi Dutta

Күн бұрын

0:00 - Real Life Use Case of Decorator Pattern
1:55 - Understanding Decorator Pattern from an OOPS Point of View
6:25 - Code Demonstration
🔴 Connect with me on Instagram - / code.blooded.voyager and ask me doubts 1:1. Would try to reply to each one of you.
🔴 Amazon SDE Revision Sheet : • Video
🔴 Join My Telegram Channel for Placement Updates and attend my Free Live Classes on DS Algo - telegram.me/ri...
🔴 Connect with me on LinkedIn - / riddhi-dutta
🔴 Graph Placement Series From Scratch - • Graphs - The Ultimate ...
🔴 Link to my TopicWise SDE Sheets Playlist : • Trees SDE Coding Probl...
Tags
#designpatterns #builderpattern #lld #oops #java

Пікірлер: 42
@ShwetaKarolMinhas
@ShwetaKarolMinhas 4 ай бұрын
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.
@sandeepsinghchauhan1198
@sandeepsinghchauhan1198 9 ай бұрын
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.
@amitrajitdas31
@amitrajitdas31 2 жыл бұрын
Great! helping me revising my OOP concepts as well as getting some insights on LLD and Design Patterns.
@adhrit1426
@adhrit1426 7 ай бұрын
Top notch explanation with great clarity. Thanks
@travelnlearn
@travelnlearn 19 күн бұрын
Nice video
@DileepV-on7wk
@DileepV-on7wk 2 ай бұрын
great explanation ::Thanks
@iamnoob7593
@iamnoob7593 2 ай бұрын
Nice
@rajsrivastava1362
@rajsrivastava1362 2 жыл бұрын
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.
@rite2riddhi
@rite2riddhi 2 жыл бұрын
Um you can. But this ideally seems a better way. Because most of the time your burger gonna contain null values. And in the cost() , there would be lot of null checks. Code readability :)
@nallunallammai6493
@nallunallammai6493 7 күн бұрын
Please put more low level design videos
@shubhampokhriyal8491
@shubhampokhriyal8491 2 жыл бұрын
great content 🎉
@rite2riddhi
@rite2riddhi 2 жыл бұрын
Thanks
@JayShah_._._
@JayShah_._._ Ай бұрын
Why do we need another abstract class birgerdecorator and not use the burger class itself ?
@girishgarg2816
@girishgarg2816 Жыл бұрын
Same can also be done by Builder pattern. For eg: Builder.addCheese(true).build(). The builder would be part of the Burger abstract class and since TandooriBurger and ZingerBurger extend Burger, so they will also get the Builder.
@rishav144
@rishav144 Жыл бұрын
great video ...pls cover more design patterns
@rite2riddhi
@rite2riddhi Жыл бұрын
Yes sure.
@kaushalcavale7596
@kaushalcavale7596 2 жыл бұрын
Very nice video. Thanks for making it
@rite2riddhi
@rite2riddhi 2 жыл бұрын
Thanks man
@nithinnarayanansaravanan7792
@nithinnarayanansaravanan7792 Жыл бұрын
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.
@hiteshza4692
@hiteshza4692 Жыл бұрын
Hi, great content & explanation, appreciate it. How can I get the code you wrote? could you share it?
@prathamj2215
@prathamj2215 Жыл бұрын
Understood! And also hungry now!😂
@deepalirathod4929
@deepalirathod4929 5 ай бұрын
Please add more videos in this series .
@raghunadh_g
@raghunadh_g 2 жыл бұрын
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 🤔
@obsessiveDreamer
@obsessiveDreamer 2 жыл бұрын
I was also thinking the same doubt, why do we need to make an extra abstract class? if we can achieve the same result by just inheriting the burger class. But I think He is doing that, just for the sake of differentiation between burgers and decorators as well as the readability of code.
@dhandobykashyapkale
@dhandobykashyapkale Жыл бұрын
@@obsessiveDreamer Makes Sense
@manishasingh-de8hi
@manishasingh-de8hi 2 ай бұрын
great explaination. Now I just feel like having a burger.
@alikagarwala210
@alikagarwala210 2 жыл бұрын
Great 💖
@rite2riddhi
@rite2riddhi 2 жыл бұрын
Thanks
@tuhinmukherjee8141
@tuhinmukherjee8141 2 жыл бұрын
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.
@prathamj2215
@prathamj2215 Жыл бұрын
I wanted to know which is a good practice considering scalability/extensibility? Passing the burger instance by reference or passing the burger instance's copy? (By value)
@neelanshgulati2643
@neelanshgulati2643 Жыл бұрын
Do we actually need the decorator class, I mean we can simply extend burger class for with cheese and mayo?
@rite2riddhi
@rite2riddhi Жыл бұрын
Otherwise how would you differentiate a normal burger like a zinger burger and a burger decorator?
@codewithnirmal
@codewithnirmal Жыл бұрын
@@rite2riddhi I think the decorator class may be needed if we need to add a decoration like smilies or any other shapes into our Burger. Correct me If I was wrong.
@lovleshbhatt7797
@lovleshbhatt7797 6 ай бұрын
what is the point of adding this BurgerDecorator , can't we directly do this in the ExtraChesse Class?
@rajrangwani5669
@rajrangwani5669 6 ай бұрын
Currently doesn't seems to have use-case of BurgerDecorator, as it is just empty abstract class, but in some cases we might need this layer, let's say for coffee maker, there can be a chocolate topping and there can be multiple chocolate types like dark chocolate, standard chocolate, etc. and all these type of chocolates should have some common property of chocolate, in that case chocolateDecorator with common property of chocolate will be required an abstract class.
@girishdoddi7698
@girishdoddi7698 2 ай бұрын
Here he added the burger object in both cheese and mayonnaise classes, but we can use decorator class to create the object right there without doing the same work multiple times in addons of cheese classes.
@easward
@easward 8 ай бұрын
Not Cheese miyo, the explanation is butter
@mansinawani8970
@mansinawani8970 7 ай бұрын
I want to eat zinger burger after watching this video.
@sayankarmakar13
@sayankarmakar13 Жыл бұрын
Hey riddhi One suggestion is that please speak slowly and apart from this everything is good.
@rahulshit8766
@rahulshit8766 Жыл бұрын
codee dada?
@siddharthdutta2946
@siddharthdutta2946 Жыл бұрын
We dont need watch memes or stupid video clips during the video.
No empty
00:35
Mamasoboliha
Рет қаралды 12 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 6 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 42 МЛН
Harley Quinn lost the Joker forever!!!#Harley Quinn #joker
00:19
Harley Quinn with the Joker
Рет қаралды 22 МЛН
What is the Decorator Pattern? (Software Design Patterns)
19:41
Be A Better Dev
Рет қаралды 25 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 244 М.
Prototype Design Pattern in Java
18:30
Telusko
Рет қаралды 142 М.
Singleton Design Pattern | Implementation with details & code ✌🏻
21:09
3. Observer Design Pattern Explanation, Walmart Design Interview Question, 2022 | LLD System Design
34:34
No empty
00:35
Mamasoboliha
Рет қаралды 12 МЛН