Implement the Decorator Design Pattern in Python

preview_player
Показать описание
How to implement the decorator design pattern in python.
Рекомендации по теме
Комментарии
Автор

This is a terrible example for the use of the decorator design pattern. Do not listen to this video. This guy is using the decorator design pattern incorrectly. The design pattern is suppose to wrap an object with another object, over and over again. Add more/less functionality to the object based on what you attached to it. It then recursively calls the inner layer until it reaches the base core object to return a result. It is not performed here and the example of wrapping a person within a person does not make sense and it not even done in this example. Completely incorrect!

josephluce
Автор

Why do we need to inherit the Person class in PersonDecorator in Python?

In Java it make sense to do that to have ability to use the PersonDecorator object as Person. Do we need to inherit the decorated class in Python which have the duck typing?

alexanderchistyakov
Автор

I also liked the IDE a lot, as well as the video of course!
Thanks.

mayankpj
Автор

Coloring is very good. Thanks for this video.

imtiazshaik
Автор

Coloring is cool. Is that hex value you are printing? Also Why is it called decorator design pattern?

devendratapdia
Автор

Are you sure this is the decorator design pattern?

majorbadidea