简体   繁体   English

uml用例图包括和扩展

[英]uml use case diagram include and extend

我在用例图上有注册配置文件和编辑配置文件。注册配置文件将是用户注册应用程序时的第一次,但是编辑配置文件将始终是我必须做的包括或扩展这些用例关系的方式

Don't make any extend and include at all. 不要做任何扩展,包括所有内容。 Just place a constraint to the use case Register Profile that it is done only once. 只需对用例“ Register Profile设置一个约束即可,该约束只能执行一次。 Include/Extend shall not be used for functional decomposition. 包含/扩展不得用于功能分解。 Their use is "highly sophisticated" (to avoid words like bloated or silly) and it is recommend to avoid them simply because of the first reason: no functional decomposition! 它们的使用是“高度复杂的”(避免使用诸如ated肿或愚蠢的词语),建议仅由于第一个原因而避免使用它们:没有功能分解!

It depends on how you see the relationship between the two use cases : 这取决于您如何看待两个用例之间的关系

  • are register profile and edit profile independent ? register profileedit profile独立? Example: someone enters your website the first time, and choose to register; 例如:有人第一次进入您的网站,然后选择注册; As soon as he saves his profile info, he comes back to the were he was. 他保存个人资料信息后,便会立即返回原来的状态。

  • or do you you see register profile as the first step before edit profile ? 还是在edit profile之前将register profile视为第一步? Example: someone enters your website the first time, and choose to register; 例如:有人第一次进入您的网站,然后选择注册; As soon as he has created his profile, he automatically is in edit profile , in case he wants to do some changes. 创建个人edit profile ,如果他要进行某些更改,他将自动进入edit profile中。 In this case edit extends register : both are self sufficient use cases, but at the end of the registration an extension point link to the extending case. 在这种情况下, edit扩展register :这两个都是自用的用例,但是在注册结束时,扩展点链接到扩展用例。

  • or do you see register profile as dependent of edit profile , which represents a significant part of it ? 还是您认为register profile依赖于edit profile ,而edit profile占了很大一部分? Example: someone enters your website and automatically gets an anonymous profile; 例如:有人进入您的网站并自动获得匿名个人资料; when he chooses to register the edit profile opens that allows him to put a name on his existing profile. 当他选择注册时,打开的edit profile将允许他在现有配置文件中添加名称。 In this case register includes edit : one can't have the first without the second. 在这种情况下, register包括edit :一个没有第二个就不能拥有第一个。

Note that personally, I'd opt for the first approach (as suggested by Thomas), as you definitely will need both interactions. 请注意,就我个人而言,我会选择第一种方法(如Thomas所建议的),因为您肯定需要两种交互。 I would reserve inclusion only use cases that are not triggered directly by the user. 我将只保留不是由用户直接触发的用例。 I would not like to use the extension as it is ambiguous (here: does edit extend register due to extension point, or does register extend edit, due to added functionality). 我不想使用扩展名,因为它是模棱两可的(在这里:由于扩展点而编辑扩展名,还是由于增加的功能而进行扩展名的注册)。 Martin Fowler in " UML distilled " strongly advises against using extensions here because of the fierce debate they usually provoke. Martin Fowler在“ UML蒸馏 ”中强烈建议不要在此处使用扩展名,因为它们通常会引起激烈的争论。

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

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