Decorator Design Pattern

preview_player
Показать описание
In this video we will learn
1. What is Decorator Design Pattern
2. Implementation guidelines of decorator design pattern
3. Simple Decorator Design Pattern example

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.

Decorator Design Pattern : As per the GOF definition, decorator Pattern states that we need to “Attach additional responsibilities to an object dynamically. Decorators provide A flexible alternative to sub classing for extending functionality.”

This pattern Falls under the category of Structural Design Pattern and is also known as Wrapper.

Implementation Guidelines : We need to use Decorator Design Pattern when
1. We need to add responsibilities to individual objects dynamically and transparently,
2. The extension by sub classing is impractical.
3. Class definition may be hidden or otherwise unavailable for sub classing.

Text version of the video

Slides

Design Patterns Tutorial playlist

Design Patterns Text articles and slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic
Комментарии
Автор

The best and the cleanest explanation... ❤

nandyad
Автор

Thanks for all your hard work. With due respect i would like to add a suggestion as you are giving example first and not continuing the same on code creates confusion

AnupShah
Автор

very useful video. Thank you sir for the detailed video.

gkkumar
Автор

Thanks for the video. isn't CarDecorator should ONLY expose ICar interface?

noamyogev
Автор

Thanks for the video. If I want to implement a new functionality like getting a DoubleOfferPrice functionality inheriting from OfferPrice class how will I implement this?

MultiSwayam
Автор

Nice video - But you call the Suzuki class and not the Hundai you have in your presentation - just info.
Question - why are you making a variable from you interface - "private ICar car" - can anybody help?

gormdrachmann
Автор

It will be great if you can discuss how we can replace Decorator Pattern with Builder Pattern.

Thank you

sovanroy
Автор

Sorry this was not very good, with all due respect, you did not make the Decorator pattern clear at all. the code never talked about Suzuki as a class, otherwise the code runs if you change Suzuki to Hyndai maybe it was from another video IDK. where are the layers? Decorator should be about layering, you talk about ice cream for 100$ a scoop but never implement the concept

bradleyr
Автор

public OfferPrice(ICar car) : base(car)
{
} why we have created this constructor

ajayjain
Автор

This is the first comment on this video.

werthero