开发者

Point of extension - Use case

开发者 https://www.devze.com 2023-03-01 10:42 出处:网络
Suppose I have a use case buy book, and the main flow is the following: 1- The user types the bo开发者_Python百科ok code that he wants to buy

Suppose I have a use case buy book, and the main flow is the following:

1- The user types the bo开发者_Python百科ok code that he wants to buy
2- The system replies that there's enough stock of the requested book
3- The user confirm

Very simple.

Now suppose I want to give the option to the user to also do another thing between 2 and 3. How should I say it? I guess it's an extension to this use case, but I'm not sure where it's the point of extension.

As far as I know, if I choose, say, point of extension in 3, then the user has the opportunity to do 3 or do all the extension but not 3. The same behaviour of alternative flows.

But what I want is different. I want some "2.5" or nothing... do it or do nothing instead; not another thing.

I'm sorry for the vague question.


One option is the format recommended in Alistair Cockburn's Writing Effective Use Cases:

2a-  User wants to do another thing:
2a1- The user does another thing
2a2- The system responds in some way, returns to step 3

Step 2a occurs after step 2 and before step 3. If the UC ends at step 2a2 then simply replace 'returns to step 3' with 'Use Case ends' or similar.

hth.


The problem here is the difference between the use case model in UML and use case descriptions. Extensions point is a concept from UML used to decouple extended and extending use cases. If you want adhere to this, you have to define the position of branching and returning back yourself, because UML says nothing about use case descriptions. I am personally as well as sfinnie a fan of Alistair Cockburns's approach to use cases, however it does not correspond well with the UML standard. There is yet another way, proposed by Bittner (Use case modeling book), who proposes to split the scenario into subflows with headlines.


I think what you actually want is an alternate path. An alternate path references a step in the main or in a different alternate path. I usually make that reference the Start step in the alternate. Then the End step is either a reference to where it returns to or an indication the path stops.

0

精彩评论

暂无评论...
验证码 换一张
取 消