Well, Franky, I believe the most important reason to use an
include relationship is because you feel you may
refactor some use case behaviour that is common to various other use cases.
It is very typical that the include use case cannot exist by its own, in other words, it is always included from other use cases, and never by direct interaction with any actor (although this is not necessarily prohibitive). The flow described in the in the
included use case is always
include as part of the flow of the
main use case. That is why the include relationship is a
dependency between the
main use case and the
included use case.
Nevertheless, there are cases when you may find useful to refactor some flow although it is not necessarily reused by other use cases. Maybe it is just reused by the same use case, or maybe it helps the reading and understanding of the use case itself.
In such cases it is a better idea to create a section named
Sub Flows in the use case specification itself where you can refactor common or specific behaviour within the same use case. In the place where this behaviour should be placed simply put the words:
Perform "The Name of the Sub Flow"..
Whatever the case, the
sub flows and
included use cases are always executed as part of the
main flow. It can be said then, any scenario instantiating the
main use case will perform the included use case.
On the other hand, the
main use case do not depend on the
extended use case. As matter of fact, the
main use case must be completely unaware of its existence. If the
extended use case is removed, the
main use case must continue to be valid.
In this regard, these kind of use cases are used to
add new behaviour to an application or simply to offer the possibility to
perform additional flows of execution based on certain conditions.
It is said the an extended use case is always performed at an
extension point within the
main use case when a
condition happens.
For example, in the "Order Item" use case, when the stock of certain item is under the
stock reorder limit, the extended use case "Reorder Item" should be performed.
In this case the
extended use case is executed depending on a
condition that will happen at the
extension point in the
main use case.
Therefore we can say that the
extended use case depends on the main use case, that is why the relationship is a
depency between the
extended use case to the
main use case.
Now, when we use an extended use case, the main use case is complete by itself. In other words it can be performed without the existence of the
extended use case. It is a common mistake to use
extended use case to depict all alternative behaviours within the
main use case.
However, if your use case have a lot of
alternative behavior (if-then-else) that do not justifies the existence of an
extended use case, then simply write them in
sub flows if you consider they shadow the
use case's business flow.
And use alternative flows to describe what happens at the
extension points.
This is hard to explain in a brief forum answer. I indeed recommend you to read the following books:
Use Case Modeling Use Cases Patterns and Blueprints
Good luck, comrade!
[ July 25, 2006: Message edited by: Edwin Dalorzo ]