In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "what is the purpose of the UML component diagram", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the purpose of the UML component diagram" this article.
The purpose of the 1.UML component diagram
The main purpose of UML component diagram is to show the structural relationship between system components. In UML 1.1, a component represents implementation projects, such as files and runnable programs. Unfortunately, this conflicts with the more common use of the term component, which refers to things like COM components. Over time and successive releases of UML, UML components have lost most of their original meaning. UML 2 formally changes the essential meaning of the concept of components; in UML 2, components are considered independent, providing one or more interfaces in an encapsulation unit in a system or subsystem. Although the UML 2 specification does not strictly declare it, components are larger design units for presenting things that will typically be implemented using replaceable components. However, unlike in UML 1. X, components must now have strict logic and design-time construction The main idea is that you can easily reuse and / or replace a different component implementation in your design because a component encapsulates behavior and implements a specific interface. one
In component-based development (CBD), UML component diagrams provide architects with a natural form to start modeling solutions. UML component diagrams allow an architect to verify that the necessary functions of the system are implemented by components, ensuring that the final system will be accepted.
In addition, UML component diagrams are useful communication tools for different groups. The diagram can be presented to key project sponsors and implementers. In general, when UML component diagrams connect the implementers of a system, UML component diagrams usually make it easier for project sponsors because they show an early understanding of the entire system to be built.
Developers find UML component diagrams useful because UML component diagrams provide them with a high-level architectural view of the system to be built, which will help developers begin to build roadmaps for implementation and decide on task allocation and / or improve requirements skills. System administrators find UML component diagrams useful because they can get an early view of the logical software components that will run on their systems. Although system administrators will not be able to determine physical devices or physical executables from the diagram, they still welcome the UML component diagram because it provides early information about components and their relationships (which allows system administrators to easily plan for the rest of the work).
two。 Symbol
Today, the symbolic set of UML component diagrams makes it one of the easiest UML diagrams to draw. Figure 1 shows a simple UML component diagram using the previous UML 1.4 notation; this example shows the relationship between two components: an Order System component that uses Inventory System components. As you can see, in UML 1.4, components are represented by a large square with two small protruding squares on its left.
Figure 1: this simple UML component diagram uses UML 1.4 symbols to show the general dependencies of Order System
The above UML 1.4 symbols are still supported in UML 2. However, the symbol set of UML 1.4 is not well adjusted in larger systems. The reason for this is that, as we will see in the rest of this article, UML 2 significantly enhances the symbolic set of UML component diagrams. Under the condition that it is easy to understand, UML 2 symbols can be adjusted better, and the symbol set also has more information.
Let's build the UML component diagram step by step according to the UML 2 specification.
3. Basics
Now, drawing a component in UML 2 is very similar to drawing a class on a class diagram. In fact, in UML 2, a component is just a special version of the class concept. This means that the symbol rules that apply to class classifiers also apply to component classifiers. If you have read and understood my previous article on general structure diagram and class diagram details [http:// www. Ibm.com/developerworks/cn/rational/rationaledge/content/feb05/bell/index.shtml], you will easily understand the UML component diagram.
In UML 2, a component is drawn as a standing rectangle stacked with selectable pieces. In UML 2, a high-level abstract view of a component can be modeled with a rectangle, including the name of the component and the text and / or icons of the component prototype. The text of the component prototype is "«component »", while the component prototype icon is a large rectangle with two protruding small rectangles on the left (the symbolic element of the component in UML 1.4). Figure 2 shows that components can be represented in three different ways in the UML 2 specification.
Figure 2: different ways to draw component name areas
When drawing a component on a diagram, it is important that you always include the component prototype text (the component in double angle brackets, as shown in figure 2) and / or icons. What's the reason? In UML, a rectangle without any prototype classifier is interpreted as a class component. Component prototypes and / or icons are used to distinguish rectangles as component elements.
4. Provide / require interface modeling for components
The Order component drawn in figure 2 represents all the valid symbolic elements; however, a typical UML component diagram includes more information. A component element can attach additional areas below the namespace. As mentioned earlier, a component is a separate unit that provides one or more public interfaces. The interface provided represents the formal contract for the services provided by the component to its users / customers. Figure 3 shows that the Order component has a second zone that represents the interfaces provided and required by the Order component.
Figure 3: the additional area here shows the interfaces provided and required by the Order component.
In the Order component example in figure 3, the component provides interfaces named OrderEntry and AccountPayable. In addition, the component requires another component to provide a Person interface. three
Other methods of component Interface Modeling in 5.UML component Diagram
UML 2 also introduces another way to display the interfaces provided and required by the component. This method is to create a large rectangle with the name of the component inside and place something called an interface symbol in the UML 2 specification on the outside of the rectangle. This second method is illustrated in figure 4.
Figure 4: an alternative method (compared to figure 3): use interface symbols to display the interfaces provided / required by the component
In this second method, there is a complete circumferential interface symbol at the end to represent the interface provided by the component-"lollipop" is the shorthand method for this interface classifier to implement relational symbols. The interface (also known as the socket) symbol with only half a circle at the end represents the interface required by the component (in both cases, the name of the interface is placed near the interface symbol itself). Even though figure 4 looks very different from figure 3, both figures provide the same information-- for example, the Order component provides two interfaces: OrderEntry and AccountPayable, and the Order component requires the Person interface.
The above is all the content of the article "what is the purpose of the UML component diagram". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.