- Spring 5 Design Patterns
- Dinesh Rajput
- 194字
- 2021-07-08 09:59:37
Composite design pattern
-GoF Design Patterns
In software engineering, the composite pattern comes under the structural design pattern. According to this pattern, a group of objects of the same type are treated as a single object by the client. The idea behind the Composite design pattern is to compose a set of objects into a tree structure to represent a module of a larger structural application. And this structure for clients is a single unit or instance uniformly.
The motivation behind the Composite design pattern is that objects in the system are grouped into the tree structure, and a tree structure is a combination of the node-leaf and branches. In the tree structure, nodes have a number of leaves and other nodes. Leaf doesn't have anything, which means there is no child of leaf in the tree. Leaf is treated as the end point of tree-structured data.
Let's look at the following figure, which represents data in the tree structure in the form of node and leaf:

- WildFly:New Features
- Mastering Zabbix(Second Edition)
- VMware vSphere 6.7虛擬化架構(gòu)實(shí)戰(zhàn)指南
- C/C++常用算法手冊(cè)(第3版)
- C語(yǔ)言程序設(shè)計(jì)
- PySide 6/PyQt 6快速開(kāi)發(fā)與實(shí)戰(zhàn)
- 好好學(xué)Java:從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)
- 一本書(shū)講透Java線程:原理與實(shí)踐
- Managing Microsoft Hybrid Clouds
- uni-app跨平臺(tái)開(kāi)發(fā)與應(yīng)用從入門(mén)到實(shí)踐
- Bootstrap for Rails
- 零基礎(chǔ)學(xué)C++(升級(jí)版)
- Learning Concurrency in Python
- Microsoft HoloLens By Example
- AngularJS UI Development