Professional Documents
Culture Documents
1 The Sub-Flow
Sometimes it is useful to split out a part of either the basic flow, or another flow, so that it can be re-used within the use case. This flow is created in a separate paragraph of the use case document and 'called' just as a sub-function would be called if we were writing code. The sub flow paragraph is given the title: "Sub-Flow: XXX", where XXX the name of the sub-flow starting with an active verb.
In the calling flow the sub-flow is invoked by referring to its name. In the example the words of the title of the sub-flow are capitalised to indicate the call. Other forms include: 'The sub-flow XXX runs here' or 'Do sub-flow XXX' which may be starting to look too much like code for non-technical users. The sub-flow always runs and returns to the point from which it was invoked, unless an exception during the sub-flow prevents it from returning. The use case then continues from that point. The sub-flow can also be used to provide alternative paths following a case statement or other selection statement if this is deemed more appropriate than using one or more alternate flows
The included use case description should be written in such a way that everything in it is entirely common to both the including use cases. If we need to include a switch which depends on the use case from which it was called, then we are including things that are not common. The 'child' use case must be independent of both parents. The reference to the included use case is written in the parent in exactly the way that a sub-flow would normally be referenced. The only difference is that the subflow is now in a separate document. This mechanism is commonly abused by decomposing a use case into steps and showing each step as a separate 'use case' on the use case diagram. This kind of functional decomposition bloats the use case model and tends to ignore the '25 to 75 use cases' rule of thumb.
2) The condition under which it inserts itself. In the example: 'the item number is found to be invalid'. 3) What happens in the alternate flow. This is written in exactly the same way that it would be written in any other flow: as numbered sentences which define largely interactions across the system boundary. 4) What happens at the end of the flow. There are 4 options: The use case terminates; the use case returns to where it was called and continues; the use case returns to prior to where it was called; the use case jumps forward. In each of the last 3, if all sentences are uniquely numbered, then all that is required is to state the line to which it returns. The alternate flow is normally just another paragraph in the use case document.
If this relationship is seen as a conditional call from the extended use case to the extension, then the call goes against the direction of the arrow, which might be confusing. Remember that the dotted arrow defines a dependency, and that the text in the extension knows about, and therefore depends on, the text in the extended flow. Not the other way round. The text in the extended use case knows nothing of, and is independent of the extension. Note that only 'Enter Order' is a use case. 'Handle Invalid Product Number' is only an alternate flow. Don't overuse this syntax. If you make every alternate flow an extension, then there will be 5 to 10 times the number of use case symbols on the diagram and lots of very small use case documents.
The arrow indicates the order in which the activities occur. It is the thread of activity A condition, in square brackets, may be used to hold up the thread until the condition becomes true. If there are multiple exits from an activity, as from 'Find Customer Record, then all exit threads should have non-overlapping conditions. This indicates a switch inside the activity The above also applies to a decision, a diamond shape, which can be used to indicate a switch between activities The activity diagram must contain a 'start state' and may contain an 'end state'
It provides a structural aspect to the procedural aspect of the use case text. It provides a place to attach detailed data format and constraint information that doesn't belong in the use case text. The prototype screen should be consistent with the use case text It doesn't have to be created in the target technology. This one was done using basic shapes in word The amount of detail in the design of the screen at this point should be relative to its importance to the users. In other words it should contain only that which is a user requirement not detailed design decisions that are unimportant to the users
Brief Description: Trigger: Type: Relationships: Association: Include: Extend: Generalization: Normal Flow of Events: 1. SubFlows: S-1: 1. S-2: 1.
Alternate/Exceptional Flows: A1. 1. DISPLAY TO USER " INVALID ITEM NUMBER , RE-ENTER ITEM NUMBER" 2 . RETURN TO ENTER ORDER 2
3.8 Chapter Summary Sub-flows are useful for re-using a common flow or as outcomes of a case statement If the sub-flow is common between two use cases, or very large, then it may be spilt out into a separate use case document and shown as a seperate use case symbol on the diagram with and 'include' relationship showing its use. An alternate flow is a conditional flow that knows how to insert itself in the original flow. If the alternate flow is very large, or optional functionality, then it may be moved to a seperate use case document and shown on the diagram as a seperate use case symbol with an 'extend' relationship to the use case it extends. An activity diagram can be created to show the overall flow of the use case but should not replace the use case text. A prototype screen is a useful second user-facing view of a use case and should be consistent with the use case text. A use case document template is useful to ensure consistency of use case text standards across a project.