Composite Design Pattern

Composite Design Pattern

SBCODE

4 года назад

3,532 Просмотров

Composite Design Pattern Article : https://medium.com/design-patterns-in-python/composite-design-pattern-7873cb695765

Design Patterns In Python Book : https://www.amazon.com/dp/B08XLJ8Z2J

The Composite design pattern,
- allows you to represent individual entities and groups of entities in the same manner. 
- is a structural design pattern that lets you compose objects into a tree. 
- is great if you need the option of swapping hierarchal relationships around. 
- makes it easier for you to add new kinds of components 
- provides flexibility of structure 
- conform to the Single Responsibility Principle in the way that it separates the aggregation of objects from the features of the object.

Examples of using the Composite Design Pattern can be seen in a filesystem directory structure, where you can swap the hierarchy of folders, and in a drawing program where you can group, un-group and transform objects, and multiple objects at the same time.

#python
#pythonDesignPatterns

Тэги:

#python #design_patterns #composite_design_pattern #B08XLJ8Z2J
Ссылки и html тэги не поддерживаются


Комментарии:

@NotTouchable
@NotTouchable - 11.06.2021 13:17

Thank you!

Ответить
@SagnikDuttaegor92
@SagnikDuttaegor92 - 22.02.2021 21:26

Noice!

Ответить
@TheUnary
@TheUnary - 20.11.2020 21:38

It will be very useful if you made a video series about SOLID principles in python like you did here :)

Ответить