简体   繁体   English

显示除“<< extend >>”或“<< include >>”之外的UML用例图的依赖关系

[英]Show dependencies on UML use case diagrams other than “<<extend>>” or “<<include>>”

How can we show simple dependencies between use cases other than "extend" or "include". 我们如何在“扩展”或“包含”之外的用例之间显示简单的依赖关系。 For example we want to say use case1 depends on use case2 which are done by user1. 例如,我们想说用例1取决于user1完成的用例2。 Can a simple arrow be used for this? 可以用一个简单的箭头吗? For which direction? 哪个方向?

Yes. 是。 There are other dependencies. 还有其他依赖项。

The full list of classes directly connected to Use Case is (fig. 18.1 of UML 2.5 standard) : 直接连接到Use Case的完整类列表(UML 2.5标准的图18.1):

  • Use Case 用例
  • Constraint 约束
  • Actor 演员
  • Include 包括
  • Extend 延伸
  • Extension point 延伸点

But that doesn't mean you can't use other UML elements in the diagram with Use Cases. 但这并不意味着您不能在图表中使用Use Cases中的其他UML元素。 UML standard DOESN'T limit any elements to diagrams. UML标准不限制图表中的任何元素。 You can even use ALL UML elements on one diagram. 您甚至可以在一个图表上使用所有UML元素。 On the other side, that would be senseless, of course. 另一方面,那当然是毫无意义的。

A usable practical set can be seen, for example, looking on the elements on the Use Case palette of the VP UML, for example. 例如,可以看到可用的实际集合,例如,查看VP UML的用例调色板上的元素。 Except already mentioned, there are: 除了已经提到的,还有:

  • System 系统
  • Dependency 依赖
  • Generalization 概括
  • Realization 实现
  • Collaboration 合作
  • Note 注意
  • Anchor
  • Containment 遏制

here you can see a shortened list with explanations. 在这里,您可以看到带有解释的缩短列表。

As you see, dependency is not only allowed by standard (all are), but widely used. 如您所见,依赖性不仅允许标准(所有都是),而且被广泛使用。

You have multiple possibilities to show dependencies between Use-Cases. 您有多种可能性来显示Use-Cases之间的依赖关系。 There are more keywords that you can use than << extend >> and << includes >>. 您可以使用比<< extend >>和<< includes >>更多的关键字。

  1. << requires >> - Indicates, that UC2 requires UC1 first to be executed. << requires >> - 表示UC2首先要求执行UC1。
  2. << follows >> - Says that this use case is executed immediately after another use case. << follow >> - 表示此用例是在另一个用例之后立即执行的。
  3. << resembles >> - Means, that this use case is similar in the result and the pre-condition, to another one, but got different actives <<类似>> - 意味着,这个用例在结果和前提条件中类似于另一个,但得到不同的活动
  4. << equivalent >> - Same Use case but got a different name. << equivalent >> - 相同的用例,但有一个不同的名称。

In your case, I would draw an arrow from the actor (user1) to case1 and then case1 << includes >> case2. 在你的情况下,我会从actor(user1)到case1绘制一个箭头,然后case1 << includes >> case2。 What you always need to keep in mind, is the purpose of your diagram. 您始终需要记住的是图表的用途。 If you are using UML as sketch, it's enough to make sure, that the diagram is understandable and within the scope. 如果您使用UML作为草图,那么足以确保图表是可理解的并且在范围内。 Over-specification won't support this. 超出规范不会支持这一点。

You say: "use case1 depends on use case2 which are done by user1". 你说:“用例1依赖于用户2完成的用例2”。

Can you clarify this? 你能澄清一下吗? How does UC1 depend on UC2? UC1如何依赖 UC2?

UC modelling can be very tricky. UC建模可能非常棘手。 It is relatively easy for the modeller to forget what an UC actually is and to mix some other system concerns in the model. 建模人员相对容易忘记UC实际上是什么,并在模型中混合其他一些系统问题。

UC model should not express dependencies derived from the underlaying system structure. UC模型不应表示从底层系统结构派生的依赖性。 For example if UC1 is implemented a component that is also used in the implementation of UC2, this situation is not shown on the UC model itself. 例如,如果UC1实现了也用于UC2实现的组件,则UC模型本身不会显示这种情况。 Is the dependency you are talking about of this mature? 您所谈论的依赖关系是否成熟?

The sequence of the execution between two UC is also normally hidden in the diagram (can be indirectly shown via pre and postconditions, but not using relationships). 两个UC之间的执行顺序通常也隐藏在图中(可以通过前置条件和后置条件间接显示,但不使用关系)。

My recommendation is to keep UC model as simple as possible, and to limit the relationship to moderate use of include and extend . 我的建议是尽可能简化UC模型,并将关系限制为适度使用includeextend UC can be seen as an abstraction of an interaction, a dialogue between actor and system. UC可以被视为交互的抽象,是演员和系统之间的对话。 How can a dialogue depend on other dialogue? 对话如何依赖于其他对话?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM