专业化或扩展点用例

Specialization or extension point use case

我这里有一个删除用例。这是试图证明用户可以删除用户、项目和帖子。如果你想删除一个用户,你 select 从删除菜单中选择“用户”,将弹出一个用户菜单对话框,你可以在其中键入一个名称,然后按“删除”以确认删除该用户。对于项目,您 select 在删除菜单中选择“项目”,然后会弹出另一个菜单,您可以在其中键入项目名称并单击“删除”以删除项目。这就是我希望在软件中实现它的方式。但是在用例中显示它我有点困惑。这是一个很好的扩展点用例来演示该功能,还是在这种情况下更好地使用的专业化,在这种情况下,父项将被“删除”,子项名为“删除用户”、“删除项目”等...

基于 Alistair Cockburn 的编写有效用例

My personal tendency is to write "Manage X", to get the advantage of less clutter, unless it turns out not to work well for some reason, usually related to the complexity of the writing, and only then break it out into "Create X", "Update X", "Delete X"

专业化

UML 规范解释说:

The extended UseCase is defined independently of the extending UseCase and is meaningful independently of the extending UseCase.

在你的情况下,我怀疑 Delete 是否独立于 Delete UserDelete ProjectDelete post。关键是用例独立于软件的内部实现。它们原则上应该代表用户目标和实现这些目标所需的一组行为。

编写有效的用例中,Cockburn 专门用一章介绍 CRUD 和参数化用例。他提供了一个有用的问题:

The question is, are they all part of a bigger case or are they separate? In principle, they are separate because each is a separate goal, possibly carried out by a different person with a different security level. However, they clutter up the use-case set and can tripple the number of items to track.

他提出了几种方法,包括参数用例的原则:通用用例(即泛化)描述一般行为,参数用于专门化用例描述。虽然他的书是关于用例规范而不是用例图,但他描述了一个比扩展更接近专业化的想法。