Chapter_5
Chapter_5
The rectangle around the use cases is called the system boundary box and, as the name
suggests,
it delimits the scope of your system.
The use cases inside the rectangle represent the functionality you intend to implement.
Packages are UML constructs that enable you to organize model elements (such as use
into
Reuse in Use Case Models: <<extend>>, <<include>>, and
Inheritance
Potential reuse can be modeled through four generalization relationships supported
by
the UML use case models:
extend relationships between use cases,
include relationships between use cases,
inheritance between use cases,
inheritance between actors.
Good Things to Know About Use Case Modelling
An important thing to understand about use case models is that the
associations between actors and use cases indicate the need for interfaces.
When the actor is a person, then to support the association, you need to develop
user interface components, such as screens and reports.
The Unified Modeling Language
(UML)
The UML is a graphical language for OOAD that gives a standard way to
write a
software system’s blueprint.
It helps to visualize, specify, construct, and document the artifacts of an OO
system.
It is used to depict the structures and the relationships in a complex system.
Systems and Models in UML
System: A set of elementsorganizedto achieve certain objectives
form a system. Systems are often divided into subsystems and described by a set of
models.
Model : Model is a simplified, complete, and consistent abstraction of a system,
created for better understanding of the system.
Cntd
…
Conceptual Model of UML
The Conceptual Model of UML encompasses three major
elements:
I. Basic building blocks
II. Rules
III. Common mechanisms
I. Basic Building Blocks: The three building blocks of UML are:
1. Things
2. Relationships
3. Diagrams
Cntd
…
1. Things: There are four kinds of things in UML, namely:
i. Structural Things: These are the nouns of the UML models representing the
static
elements that may be either physical or conceptual. The structural things are
class, object…
ii. Behavioral Things : These are the verbs of the UML models representing the
dynamic
behavior over time and space.
iii.Grouping Things: They comprise the organizational parts of the UML models.
There is
only one kind
comments of grouping
applied thing, i.e., package.
to describe
Cntd
…
2. Relationships :Relationships are the connection between things.
The four types of relationships that can be represented in UML are:
I. Dependency: This is a semantic relationship between two things such that a change
in one thing brings a change in the other.
II. Association: This is a structural relationship that represents a group of links
having common structure and common behavior.
III. Generalization: This represents a generalization/specialization relationship in
which subclasses inherit structure and behavior from super-classes.
IV. Realization: This is a semantic relationship between two or more classifiers such
that one classifier lays down a contract that the other classifiers ensure to stand.
Cntd
…
3. Diagrams : A diagram is a graphical representation of a system.
It comprises of a group of elements generally in the form of a
graph.
UML includes nine diagrams in all, namely:
aspects of a system.
The behavioral diagrams are categorized as follows: use case interaction
diagrams, diagrams, state–chart diagrams, and activity diagrams.
Use Case Model
Use Case: A use case describes the sequence of actions a system performs
yielding visible results.
It shows the interaction of things outside the system with the system itself. Use
cases may be applied to the whole system as well as a part of the system.
Actor: An actor represents the roles that the users of the use cases play. An actor
may be a person (e.g. student, customer), a device (e.g. workstation), or another.
Cntd
…
The following figure shows the notations of an actor named Student and a use
case
called Generate Performance Report
Cntd
…
5. Use Case Diagrams
Use case diagrams present an outside view of the manner the elements in a
system
behave and how they can be used in the context.
Use case diagrams comprise of:
Use cases
Actors
Relationships like dependency, generalization, and association Use case
diagrams are used:
Model the context of a system by enclosing all the activities of a system within
a rectangle and focusing on the actors outside the system by interacting with it.
To model the requirements of a system from the outside point of view
Cntd
…
E.g., Let us consider an Automated Trading House System. We assume the
following
features of the system:
The trading househas transactionswith two types of customers,
individual customers and corporate customers.
Once the customer places an order, it is processed by the sales department and
the
customer is given the bill.
The system allows the manager to manage customer accounts and answer
any queries posted by the customer.
Cntd
…
Interaction Diagrams: it depict interactions of objects and their relationships.
They also include the messages passed between them. There are two types of
interaction diagrams:
Sequence Diagrams and Collaboration Diagrams
Interaction diagrams are used for modeling:
the control flow by time ordering using sequence diagrams.
the control flow of organization using collaboration diagrams.
6. Sequence Diagrams: are interaction diagrams that illustrate the ordering of
messages
according to time.
Notations: These diagrams are in the form of two-dimensional charts. The objects
that
The messages that these objects send and receive placed along the y-axis, in
initiate the interaction are placed on the x–axis. the
are order of increasing time from top to bottom
Cntd
…
E.g., A sequence diagram for the Automated Trading House System is shown in
the
following figure.
Cntd
…
7. Collaboration Diagrams are interaction diagrams that illustrate the structure of
the
objects that send and receive messages.
Notations : In these diagrams, the objects that participate in the interaction are
shown using vertices.
The links that connect the objects are used to send and receive messages. The message
is
shown as a labeled arrow.
Example: Collaborationdiagramfor the AutomatedTrading House
System is illustrated in the figure below
Cntd
…
8. State–Chart Diagrams
A state–chart diagram shows a state machine that depicts the control flow of an
object
from one state to another.
A state machine depicts the sequences of states which an object undergoes due
to
events and their responses to events.
State–Chart Diagrams include of:
States: Simple or Composite
Transitions between states
Events causing transitions
Actions due to the events
Cntd
…
Example, In the Automated Trading House System, let us model Order as an
object and trace its sequence. The following figure shows the corresponding
state–chart diagram.
Cntd
…
9. Activity Diagrams:An activity diagramdepictsthe flow of activities which
are
ongoing non-atomic operations in a state machine.
Activities result in actions which are atomic operations.
Activity diagrams include of:
Activity states and action states
Transitions
Objects
Activity diagrams are used for modeling:
Workflows as viewed by actors, interacting with the system.
details of operations or computations using flowcharts.
Cntd
…
Example, The following figure shows an activity diagram of a portion of the
Automated
Trading House System.
End of chapter Five
Any Question?