组件图依赖与装配 [英] Component diagram dependency vs assembly

查看:104
本文介绍了组件图依赖与装配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难理解UML组件图中依赖项和程序集(球和套接字)之间的区别.

I'm having a hard time understanding the difference between dependency and assembly(ball and socket) in UML component diagram.

我在Google上搜索了很多,只发现了这个相对问题:

I googled a lot and only found this relative question : uml component diagram difference between assembly and interfaces with dependency

但是我不太明白这个问题的答案,我特别想问:

But I don't really understand the answer to that question, I specifically want to ask :

  1. 定义级别"和实例级别"是什么意思?我了解只有一幅图,有两幅吗?
  2. 是否有两个,能否给我一个有效的示例,该示例具有依赖"和程序集",并解释为什么第一个是依赖"而第二个是程序集"?

请注意,我并不是在问我在网络上找到的任何特定图像,我一般是在这里问,我也想要Uml 2 :).

Note that I'm not asking about any particular image I found on web, I'm asking here in general, Also I want Uml 2 :) .

我喜欢示例,因为我不理解UML中的所有单词,而且我更喜欢这些示例有些实际,不是"A和B",而是"Order and Person".

I prefer examples because I don't understand all the words in UML, also I prefer these examples to be somewhat realistic , that is not "A and B" but for example "Order and Person".

我的目标是为毕业项目绘制组件图,并将其交给教授:).

My goal of the question is to draw the Component diagram for our graduation project that we'll give to the professor :) .

推荐答案

组件是一个软件.这是类级别(定义级别).该软件可能安装在多台计算机上,或者可能有多个实例在同一台计算机上运行.这是实例级别.如果在您的情况下,每个组件仅被实例化一次,那么您仅需要一个图来显示实例.否则,最好有一张图显示类级别,而一张图显示实例级别.

A component is a piece of software. This is the class level (definition level). This piece of software may be installed on multiple machines, or maybe multiple instances may be running on the same machine. This is the instance level. If, in your case, each component is instantiated only once, then you only need one diagram, showing the instances. Otherwise, it would be good to have one diagram show the class level and one diagram show the instance level.

例如,有一个名为EmployeeProvider的组件,该组件提供用于访问员工数据库的服务.假设有一个实例在美国运行,一个实例在欧洲运行.还假设有一个报告生成器组件,该组件仅具有一个实例,该实例从两个员工数据库中读取信息.在下面,您可以看到两个图表,一个显示类别级别(顶部),另一个显示实例级别(底部).

For example, there is a component called EmployeeProvider, which provides services to access an employee database. Suppose there is an instance running in the USA and one instance running in Europe. Suppose also that there is a report generator component, which only has one instance, which reads information from both employee databases. Below you can see two diagrams, one showing the class level (top) and one showing the instance level (bottom).

这篇关于组件图依赖与装配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆