The Decorator Pattern Explained and Implemented in Java | Structural Design Patterns | Geekific

preview_player
Показать описание

Today, we add another Structural design pattern to our Design Patterns in Java series: The Decorator Design Pattern.

Timestamps:
00:00 Introduction
00:07 What is the Decorator Pattern?
02:13 Decorator Pattern Implementation
04:21 The Decorator Pattern Class Diagram
05:51 Recap
06:32 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #DesignPatterns #DecoratorPattern #StructuralPatterns
Рекомендации по теме
Комментарии
Автор

Bro gotta be tired from carrying so many students through softwaredesign courses. No but seriously thank you soo much for your comprehensive content <3.

Samuel-vqjo
Автор

I had to watch this twice to fully understand it. I would have gotten it just via my course material. Thank you so much :)

JB-gvpt
Автор

This is the go to channel when you need a refresh on some design pattern

lukasaudir
Автор

This is the best "Design Pattern" playlist.
You are an amazing teacher.

aman
Автор

Been learning these as I go, and man while it’s tough to understand immediately, it feels so satisfying to have a go at them and understand how you can use them on your own

thebulletkin
Автор

Thanks a lot mate. Your code examples helped very much, but also the diagram and general explanation. Exactly what I needed. You are a good Teacher.

root
Автор

The other tutorials always executed a code on the decorator before executing the wrapped code, I didn`t think that I can call the wrapped code before, just like you did, nice video man.

moisesdepaulodias
Автор

WTF, the way you explain things is the best ever I've seen!

DjangoMx
Автор

Your video style is very well executed, helped me wrap my head around this topic. Especially the code example, and how the method calls bubbled up to parent classes. Keep up the high quality! Subscribed ❤

tornhackker
Автор

Thanks for nice explanation of Decorator Pattern, it is really helpful. 😀😀

dhritymanmukherjee
Автор

Thanks so much for this very clear course !

rayunn
Автор

Great video! I was wondering if it would be possible to use the Composite pattern here? We can have that Whatsapp and Email notifications implement the Notifier interface and then have compositeApps which can include any platform (Whatsapp, email, facebook, etc). Thanks in advance!

butterbutter
Автор

Hey, can anyone tell me why Notifier is also implementing another system in its send function? I believe Notifier has to at least have a send function since it is based on INotifier. But in our current structure, won't every single implementation send message by mail even if it's not required?

sharif
Автор

what is the need to create basenotifier, we can just send it directly to the next object

battuhant
Автор

Why can’t the client can instantiate two notifier classes and notify the user instead of creating subclasses of combinations?

kerakricks
Автор

But in this example i can't have e plain facebook notifier without the email notifier (the first Notifier concrete component), right?

MrOcelot
Автор

Thank you for your video, it is helpful. But i miss one thing. The problem with inheritance you introduced was that we need to create multiply subclasses such WhatsappSmsNotifier, SmsFacebookNotifier, WhatsappFacebookNotifier and then you introduced approach with decorators.

The thing I dont understand how decorators solve your example problem ? If user wants to receive notifications via SMS and Whatsapp we still need to create a SmsWhatsappDecorator, dont we ? Thank you for your response.

koetjape
Автор

Question: Is it not better to use the observer pattern in this situation instead?
I mean, it is much easier to store an array of notify objects and on notifyMethod, iterate through the notify array calling notify.execute(), if you know what I mean;

guilhermegavioli
Автор

Great Video Bro.
where can i find the slides ?

infoplus
Автор

Other than one being Creational and the other being Structural, what is the difference between the Decorator and Factory pattern? I know in Factory the subclasses of the component can create an object of the subclasses of the Decorator class, but they seem to be implemented in the same way.

OnutcOme