Detailed explanation of object structure pattern of composite model in Java
•
Java
Detailed explanation of object structure pattern of composite model in Java
1、 Intention
Combine objects into a tree structure to represent a "part whole" hierarchy. Composite enables users to use single objects and composite objects consistently.
2、 Applicability
You want to represent the part of the object - the overall hierarchy
You want users to ignore the difference between composite objects and single objects. Users will use all objects in the composite structure uniformly.
3、 Structure
4、 Code
If you have any questions, please leave a message or go to the community of this site for exchange and discussion. Thank you for reading. I hope it can help you. Thank you for your support to this site!
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码