views:

1074

answers:

3

What's is the difference between include and extend in a use case diagram?

+2  A: 

I wouldn't do a better job than Scott Ambler at explaining how they can be used for reuse in use-case models and how they differ. So instead of paraphrasing him, I'd suggest to read Reuse in Use-Case Models: <<extend>>, <<include>>, and Inheritance.

Pascal Thivent
A: 

I have often also to re-read some docs. Time ago, I wrote a post about it, taking things from different sources and summarizing them a bit. Maybe it helps you: * link *

Juri
A: 

Extend is used when a use case conditionally adds steps to another first class use case.

For example, imagine "Withdraw Cash" is a use case of an ATM machine. "Assess Fee" would extend Withdraw Cash and describe the conditional "extension point" that is instantiated when the ATM user doesn't bank at the ATM's owning institution. Notice that the basic "Withdraw Cash" use case stands on its own, without the extension.

Include is used to extract use case fragments that are duplicated in multiple use cases. The included use case cannot stand alone and the original use case is not complete without the included one. This should be used sparingly an only in cases where the duplication is significant and exists by design (rather than by coincidence).

For example, the flow of events that occurs at the beginning of every ATM use case (when the user puts in their ATM card, enters their PIN, and is shown the main menu) would be a good candidate for an include.

Doug Knesek