Uml - Use Case Diagrams
Uml - Use Case Diagrams
Uml - Use Case Diagrams
• Use case diagrams are used to depict the context of the system to be built
and the functionality provided by that system.(DFD LEVEL 0 IN SAD)
• They depict who (or what) interacts with the system. They show what the
outside world wants the system to do.(USER REQUIREMENTS)-ACTORS
• A use case is a methodology used in system analysis to identify, clarify,
and organize system requirements.
• It allows you to very quickly scope the system – what is included and what
is not – and give the team a comprehensive picture of what the system will
do.
• Use case diagrams will specify the events in a system and how those
events flow, however, use case diagram does not describe how those
events are implemented.
• Its high level and doesn’t show any details (DFDLEVEL 0)
UML-USE CASE DIAGRAM
For example, in the previous banking example, there might be a use case called “Pay Bills”. This can be
generalized to “Pay by Credit Card”, “Pay by Bank Balance” etc.
Another Example is “Place order”. This can be generalized as “special Order” and “Normal Order”
Generalization of an Actor
• Generalization of an actor means that one actor can inherit the role of the other
actor.
• The descendant inherits all the use cases of the ancestor. The descendant has one
or more use cases that are specific to that role. Let’s expand the previous use case
diagram to show the generalization of an actor.
«include» Relationships:
Include relationship show that the behavior of the included use case is part of
the including (base) use case. The main reason for this is to reuse common
actions across multiple use cases. In some situations, this is done to simplify
complex behaviors. Few things to consider when using the <<include>>
relationship.
• The base use case is incomplete without the included use case.
• The included use case is mandatory and not optional.
• Includes is usually used to model common behavior
<<extends>> Relationship
While developing your use cases, you may find that certain activities might be
performed as part of the use case but are not mandatory for that use case to run.
• The extending use case is usually optional and can be triggered
conditionally(HAPPENS ONLY WHEN CONDITION IS MET) . In the diagram, you can
see that the extending use case is triggered only for deposits over 10,000 or when
the age is over 55.
• The extended (base) use case must be meaningful on its own. This means it
should be independent and must not rely on the behavior of the extending use case.
Example: one can get help on registration before registration(read guidelines)
• The extension is conditional, which means its execution is dependent on what has
happened while executing the base use case. The base use case does not control the
conditions for the execution of the extension – the conditions are described within
the extend-relationship.
ASSOCIATION BETWEEN A USECASE AND AN ACTOR
This one is straightforward and present in every use case diagram. Few things to note.
• An actor must be associated with at least one use case.
• An actor can be associated with multiple use cases.
• Multiple actors can be associated with a single use case.
• E.g. a students borrowing a book from a librarian
A COMPLETE USE CASE DIARAM –ORDER PROCESSING
SYSTEM
HOTEL RESERVATION SYSTEM
CLASS EXERCISE
TO BE EMAILED