In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the characteristics of web combination mode". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what are the characteristics of web combination mode"!
Intention
The subordinate elements are managed in a combined way, providing the same interface for all levels of nodes while implementing a tree data structure, and users can look at each node on the tree from the same point of view.
motivation
There are a lot of tree structures in the real world. Let's look at two examples. The first is the company's organizational chart:
Through observation, it can be found that the tree structure in these two examples has the following characteristics:
There are parent nodes on the tree that contain other nodes, and there are also page child nodes that do not contain other nodes.
The parent node and the subordinate node can be regarded as the relationship between the whole and the part.
The subordinate node may also be the parent of another node.
This inclusion relationship may have many layers.
There are usually some common operations that need to spread from the parent node to the child node.
The last point is not reflected in the picture, which is supplemented here. The so-called common operation, for the company organization chart, can be issued notices, collection of performance data, evaluation, etc.; for computers, it can be switching power supply and so on. Of course, what kind of operation is actually needed is determined according to the demand, but in general it is easy to find out the common operation.
When modeling the tree structure above, the general approach is to design a class for each element, but there is a problem: the parent node class that contains other elements has two common functions: one is to manage the child node. the other is to spread the operation. So optimize the class diagram to get the following class diagram.
In this class diagram, PartsGroup takes on the responsibility of managing child nodes and spreading common operations. It can manage any Parts class and also contain additional PartsGroup objects. This combination relationship can be repeated many times according to the demand.
In this way, the user does not have to care about the specific type of node, whether it contains subordinate nodes, and how many layers of subordinate nodes there are, just call its operation on the node in front of it.
At this point, I believe that you have a deeper understanding of "what are the characteristics of the web combination model?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.