- 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:

- 黑客攻防從入門到精通(實(shí)戰(zhàn)秘笈版)
- 一步一步學(xué)Spring Boot 2:微服務(wù)項(xiàng)目實(shí)戰(zhàn)
- 程序員修煉之道:程序設(shè)計(jì)入門30講
- ReSharper Essentials
- Debian 7:System Administration Best Practices
- Learning AWS Lumberyard Game Development
- R的極客理想:工具篇
- Visual C++應(yīng)用開發(fā)
- Apache Spark 2.x for Java Developers
- Unity 2017 Mobile Game Development
- Android Wear Projects
- Rust游戲開發(fā)實(shí)戰(zhàn)
- Clojure for Machine Learning
- IBM Cognos TM1 Developer's Certification guide
- HTML5 Canvas核心技術(shù):圖形、動(dòng)畫與游戲開發(fā)