Project Life Cycle  «Prev  Next»
Lesson 8 Extends stereotype and generalization
ObjectiveIdentify and model the Extends stereotype and generalization of use cases

Extends Stereotype and Generalization

Within any given system, there are usually a number of different ways to accomplish a task.
The UML provides two ways to model these variations: the Extends stereotype and generalization.

Extends dependency stereotype

Some processes include optional behavior or behavior that is used only in specific circumstances. To include the flow of events in the main flow would unduly confuse the use case narrative. For example, some checking accounts can be attached to a line of credit or savings account. If the client attempts to withdraw funds beyond the checking account balance, extra logic is needed to access the funds in the attached account.
You can separate this extra flow of events into its own use case. When it is needed, it can be referenced in the use case narrative.

Transfer Funds extends Withdraw Funds
  1. Use the dependency (dashed) arrow from the new or extending use case to the use case that is being extended
  2. Place the <<extends>> stereotype on the arrow.

Generalization

Generalization works the same in use case modeling as in object modeling. Both actors and use cases may be generalized. The specialized form of actor or use case inherits all the properties of the base actor or use case. The specialized element may then override or add to the properties of the base definition.
Use case diagrams use the same notation as class diagrams to show generalization. Draw a line from the specialized element to the base or generalized element. Place a triangle at the base element end of the line with the apex touching the base element.

For example a perferred customer is a type of customer. A preferred customer actor may replace a customer actor anywhere a customer actor is used (the rule of substitution)
  1. Preferred Customer inherits from Customer
  2. a) Direct Deposit Funds and b) Deposit from other Account inherits from Deposit Funds

Include Extends Generalize - Quiz

Click the Quiz link below to take a short multiple-choice quiz on the Include and Extend stereotypes and generalization.
Include Extends Generalize - Quiz

Extends Dependency Stereotype - Exercise

Click the Exercise link below to update the course project use case diagram.
Extends Dependency Stereotype - Exercise