UML 关系“使用"和“包含"是否相同? [英] Are UML relationships «use» and «include» same?

查看:24
本文介绍了UML 关系“使用"和“包含"是否相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用例图中使用"和包含"的关系是否相同?

Are the relationships «use» and «include» same in use case diagrams?

推荐答案

  • «use» 不是用例图的标准元素.但是 UML 标准允许使用外部图表元素.因此,您可以正式使用通常属于类图元素并且是一种依赖关系的 «use» 元素.它的意思是:
  • 用法是一种依赖,其中一个 NamedElement 需要另一个NamedElement(或 NamedElements 集)的完整实现或手术.Usage 没有指定客户如何使用供应商除了供应商被定义或客户端的实现.

    A Usage is a Dependency in which one NamedElement requires another NamedElement (or set of NamedElements) for its full implementation or operation. The Usage does not specify how the client uses the supplier other than the fact that the supplier is used by the definition or implementation of the client.

    (引用自 UML 2.5 标准)

    • «包含»

    " 是两个 UseCases 之间的 DirectedRelationship,表示包含的用例(添加)的行为被插入到包含用例(includeCase)的行为也是一个一种 NamedElement 以便它可以在其上下文中具有名称拥有用例.包含的用例可能取决于更改通过执行包含的用例生成.包含的用例必须可用于包含用例的行为完整描述.".

    "is a DirectedRelationship between two UseCases, indicating that the behavior of the included UseCase (the addition) is inserted into the behavior of the including UseCase (the includingCase) It is also a kind of NamedElement so that it can have a name in the context of its owning UseCase. The including UseCase may depend on the changes produced by executing the included UseCase. The included UseCase must be available for the behavior of the including UseCase to be completely described.".

    (引用自 UML 2.5 标准)

    因此,这两种联系在含义上非常接近,但在技术上并不相同.

    So, both these two sorts of connections are very close in meaning, but are not the same technically.

    • 用法适用于命名元素和包括行为.
    • Incliding 是一个更强大的元素 - 它可以是 NamedElement 本身.
    • 恕我直言,它们的主要区别在于用法可以描述实现.
    • 此外,Usage 可以将一个 Include 连接到其他一些 NamedElement.包括无法连接的用法.这种差异足够大,但不是很重要,因为很少需要这种联系.

    形式上,您可以在用例中同时使用它们,但真正的原因很少发生.最现实的情况是当您在用例图中使用某些类时(也是允许的),并在它们之间使用使用".

    Formally, you can use them both in Use case, but the real reason for it can happen rarely. The most realistic case is when you use some classes in Use Case diagram (it is allowed, too), and use «use» between them.

    这篇关于UML 关系“使用"和“包含"是否相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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