组件图小结

来源:互联网 发布:美国私立高中 知乎 编辑:程序博客网 时间:2024/04/29 10:28
1. What is the component?
In UML2.0,components are considered autonomous, encapsulated units within a system or subsystem that provide one or more interfaces

components are now strictly logical, design-time constructs. The idea is that you can easily reuse and/or substitute a different component implementation in your designs because a component encapsulates behavior and implements specified interfaces.

2. What is the artifact?
The physical items that UML1.x called components are now called "artifacts" in UML 2. An artifact is a physical unit, such as a file, executable, script, database, etc. Only artifacts live on physical nodes; classes and components do not have "location." However, an artifact may manifest components and other classifiers (i.e., classes). A single component could be manifested by multiple artifacts, which could be on the same or different nodes, so a single component could indirectly be implemented on multiple nodes.]''


3. What is the function of component diagram?
1)In component-based development (CBD), component diagrams offer architects a natural format to begin modeling a solution. Component diagrams allow an architect to verify that a system's required functionality is being implemented by components, thus ensuring that the eventual system will be acceptable.

2) In addition, component diagrams are useful communication tools for various groups

4. How to draw a component?
a component is drawn as a rectangle with optional compartments stacked vertically. The high-level, abstracted view of a component contains the next.
1) a rectangle; 2) a stereotype text; 3) a icon; 4) a name.
It is important to include the stereotype text and/or the icon when drawing component. That means that one of them at least appears. 

See the examples.


5. How to model a component's interfaces provided or required?
1. Use compartment.

2. Use interface icon.

6. How to model component relationship?


Reference:
https://www.ibm.com/developerworks/rational/library/dec04/bell/
原创粉丝点击