我需要指定删除 2 种类型的对象 x 和 y 的用例,其中 y 是对象 x 的列表。
我想避免用例过度碎片化,因为两个用例之间的事件流是相似的。 我应该指定 2 个用例,
Delete x
和 Delete y
,还是单个用例 Delete object
,其中包含删除 x 的主要场景和删除 y 的替代场景?或者有更好的解决方案?更一般地说,对于类似的情况,例如共享对象 x 和对象 y,推荐的方法是什么以及何时使用替代方案?
这就是我对第一个选项的意思:
用例删除x
Pre-conditions: Authentication Post-Condition: The object x is deleted Main scenario: 1.The actor starts the use case 2.The system shows the list of objects x 3.The actor selects the object x to delete 4.The system deletes the object x
用例删除 y
Pre-conditions: Authentication Post-Condition: The object y is deleted Main scenario: 1.The actor starts the use case 2.The system shows the list of objects y 3.The actor selects the object y to delete 4.The system deletes the object y
还有第二个选项:
用例删除对象
Pre-conditions: Authentication Post-Condition: The object is deleted Main scenario: 1.The actor starts the use case 2.The system asks to the actor if he want to delete object x or object y 3.The actor makes his choice 4.The system shows the list of objects x 5.The actor selects the object x to delete 6.The system deletes the object x 3.a 1. activate the scenario "Object y" Alternative scenario #1 - Object y 1.The system shows the list of objects y 2.The actor selects the object y to delete 3.The system deletes the object y
您应该根据用户目标识别相关用例,而不是根据用户界面或系统的内部结构。
考虑您的解释,并假设您需要在该详细程度上工作:
但是,您的示例表明您可能还有其他 CRUD 用例。如果您不想以大量案例和场景结束,则有更好的 CRUD 方法:利用专业化(继承):编写一个通用场景,并为参与者想要删除的对象提供占位符。在这种情况下,您不需要额外的场景或额外的用例,除非一个或其他对象需要不同的行为,在这种情况下,您最好不要重复自己并将特殊情况记录为替代场景。
这些问题中的更多信息:
顺便说一句:恭喜您通过了身份验证!