Include and exclude relationship in uml

UML Use Case "extend" and "include" relationships

include and exclude relationship in uml

This use case diagram relationships tutorial will cover all you need to know about relationships in use cases. Learn about include, extend. Creating Use Case Diagram with Free UML Case Tool What is the difference between include and exclude relationship in use case diagrams? Views. 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.

So the key point in the extends relationship is "optional"! It adds further functionality to the base use case which may be restricted by constraints.

include and exclude relationship in uml

The following diagram shows this: Consider the "Order Wine" and "Serve Wine" use cases. The "Order Wine" extends the "Order Food", meaning that wine may be ordered by the customer, but not necessarily optional. Therefore the use case "Server Wine" has a condition on its extend relationship: The notation is a arrow with a white triangle at the end, basically the same that is used for defining the inheritance extends relationship in the UML class diagrams.

For example, you may discover several use cases need the behavior to search for and then update information about students, indicating the potential need for an "Update Student Record" use case included by the other use cases. Why should you bother maintaining an "Includes" and an "Extends" list in your use cases? The answer is simple: Yes, it would be nice if everyone has access to the use-case diagram because it also contains this information, but the reality is that sometimes you use different tools to document each part of your model.

For example, your diagrams could be drawn using a drawing package and your use cases documented in a word processor. Some of your project stakeholders may have access to the word processor you are using, but not the drawing package.

include and exclude relationship in uml

The main disadvantage of this approach is you need to maintain these two lists in parallel with the diagram, the danger being they may become unsynchronized.

Inheritance Between Use Cases Use cases can inherit from other use cases, offering a third opportunity to indicate potential reuse. Figure 1 depicts an example of this, showing that "Enroll Family Member in University" inherits from the "Enroll In University" use case.

  • UML Use Case "extend" and "include" relationships
  • UML Use Case Include

Inheritance between use cases is not as common as either the use of extend or include dependencies, but it is still possible. The inheriting use case would completely replace one or more of the courses of action of the inherited use case. In this case, the basic course of action is completely rewritten to reflect that new business rules are applied when the family member of a professor is enrolling at the university.

Family members are allowed to enroll in the school, regardless of the marks they earned in high school, they don't have to pay any enrollment fees, and they are given top priority for enrollment in the university.

Inheritance between use cases should be applied whenever a single condition, in this case, the student is a family member of a professor, would result in the definition of several alternate courses.

UML Use Case Extend

Without the option to define an inheriting use case, you need to introduce an alternate course to rework the check of the student's high-school marks, the charging of enrollment feeds, and for prioritization of who is allowed to enroll in the given semester. The inheriting use case is much simpler than the use case from which it inherits. It should have a name, description, and identifier, and it should also indicate from which use case it inherits in the "Inherits From" section.

This includes any section that is replaced, particularly the pre-conditions and post-conditions as well as any courses of action. If something is not replaced, then leave that section blank, assuming it is inherited from the parent use case you might want to put text, such as "see parent use case," in the section.

Inheritance Between Actors The fourth opportunity for indicating potential reuse within use-case models occurs between actors: An example of this is shown in Figure 1the "International Student" actor inherits from "Student. When two or more use cases have some common behaviorthis common part could be extracted into a separate use case to be included back by the use cases with the UML include relationship. Execution of the included use case is analogous to a subroutine call or macro command in programming.

Reuse in Use-Case Models: >, >, and Inheritance

All of the behavior of the included use case is executed at a single location in the including use case before execution of the including use case is resumed.

Note, while UML 2. Including use case depends on the addition of the included use case, which is required and not optional. It means that including use case is not complete by itself, and so it would make sense to refer to the including use cases as abstract use cases. Neither of UML 2.