Beruflich Dokumente
Kultur Dokumente
LANGUAGE (UML)
Unified Modeling Language
a standard language for specifying, visualizing,
constructing, and documenting the artifacts of
software systems, as well as for business modeling
a mostly graphical modeling language that is used
to express designs
describes a notation and not a process
helps project teams communicate, explore potential
designs, and validate the architectural design of the
software
Goals of UML
Provide users with a ready-to-use, expressive visual
modeling language so they can develop and
exchange meaningful models.
Provide extensibility and specialization mechanisms
to extend the core concepts.
Be independent of particular programming
languages and development processes.
Goals of UML …cont.
Provide a formal basis for understanding the
modeling language.
Encourage the growth of the OO tools market.
Support higher-level development concepts such as
collaborations, frameworks, patterns and
components.
Integrate best practices.
Why use UML?
to improve the quality of software products and
reduce cost and time-to-market
To effectively manage the complexity of systems as
they increase in scope and scale
the need to solve recurring architectural problems, such
as physical distribution, concurrency, replication,
security, load balancing and fault tolerance
Types of UML Diagrams
Use Case Diagrams
Class Diagrams
Interaction Diagrams
Sequence & Collaboration Diagrams
State Diagram
Activity Diagram
Physical Diagrams
Component & Deployment Diagrams
Use Case Diagrams
A use case diagram displays the relationship
among actors and use cases.
Use Case Diagram
A use case is a set of scenarios that describing an
interaction between a user and a system.
Use case diagrams describe what a system does
from the standpoint of an external observer.
The emphasis is on what a system does rather than
how.
The two main components of a use case diagram
are use cases and actors.
Actors & Use Cases
An actor is represents a user or another system that
will interact with the system you are modeling.
A use case is an external view of the system that
represents some action the user might perform in
order to complete a task.
Use case diagrams are closely connected to
scenarios.
A scenario is an example of what happens when
someone interacts with the system.
The Scenario
"A patient calls the clinic to make an appointment
for a yearly checkup. The receptionist finds the
nearest empty time slot in the appointment book
and schedules the appointment for that time slot. "
The Use Case Diagram
When to use diagram?
helpful in exposing requirements and planning the
project.
Use case diagrams are helpful in three areas.
determining features (requirements). New use cases often
generate new requirements as the system is analyzed and
the design takes shape.
communicating with clients. Their notational simplicity
makes use case diagrams a good way for developers to
communicate with clients.
generating test cases. The collection of scenarios for a use
case may suggest a suite of test cases for those scenarios.
How to draw Use Case Diagram?
Start by listing a sequence of steps a user might
take in order to complete an action.
For example a user placing an order with a sales
company might follow these steps.
Browse catalog and select items.
Call sales representative.
Multiplicities Meaning
zero or one instance. The notation n . .
0..1
m indicates n to m instances.
no limit on the number of instances
0..* or *
(including none).
1 exactly one instance
1..* at least one instance
Relationships in Class Diagrams
Generalization
used when two classes are similar, but have some
differences.
has a triangle pointing to
the superclass
Relationships in Class Diagrams
Aggregation
an association in which one class belongs to a collection.
An aggregation has a diamond end pointing to the
part containing the whole.
In our diagram, Order has a collection of OrderDetails.
How to draw Class Diagrams?
consider the three different perspectives of the
system the diagram will present; conceptual,
specification, and implementation.
When designing classes consider what attributes
and operations it will have.
Then try to determine how instances of the classes
will interact with each other.
The Class Diagram
A Customer Ordering System
Interaction Diagrams
Interaction diagrams model the behavior of use
cases by describing the way groups of objects
interact to complete the task.
The two kinds of interaction diagrams are
sequence and collaboration diagrams.
Sequence Diagrams
an interaction diagram that details how operations
are carried out -- what messages are sent and
when.
organized according to time.
The time progresses as you go down the page.
The objects involved in the operation are listed from
left to right according to when they take part in the
message sequence.
Hotel Reservation
Explanation
The Reservation window sends a
makeReservation() message to a HotelChain.
The HotelChain then sends a makeReservation()
message to a Hotel.
If the Hotel has available rooms, then it makes a
Reservation and a Confirmation.
Explanation
Each vertical dotted line is a lifeline, representing
the time that an object exists.
Each arrow is a message call.
An arrow goes from the sender to the top of the
activation bar of the message on the receiver's
lifeline.
The activation bar represents the duration of
execution of the message.
Explanation
In our diagram, the Hotel issues a self call to
determine if a room is available.
If so, then the Hotel creates a Reservation and a
Confirmation.
The asterisk on the self call means iteration (to
make sure there is available room for each day of
the stay in the hotel).
The expression in square brackets, [ ], is a
condition.
Collaboration Diagrams
are also interaction diagrams
They convey the same information as sequence
diagrams, but they focus on object roles instead of
the times that messages are sent.
In a sequence diagram, object roles are the vertices
and messages are the connecting links.
Hotel Reservation System
Collaboration Diagram Notations
The object-role rectangles are labeled with either
class or object names (or both).
Class names are preceded by colons ( : ).
Each message in a collaboration diagram has a
sequence number.
The top-level message is numbered 1. Messages at
the same level (sent during the same call) have the
same decimal prefix but suffixes of 1, 2, etc.
according to when they occur.
When to use Interaction Diagrams?
used when you want to model the behavior of
several objects in a use case.
They demonstrate how the objects collaborate for
the behavior.
Interaction diagrams do not give a in depth
representation of the behavior.
If you want to see what a specific object is doing
for several use cases use a state diagram.
How to draw Sequence Diagrams?
A class start the behavior by sending a message to
an object of another class.
Messages pass between the different objects until
the object of the first class receives the final
message.
How to draw Collaboration
Diagrams?
objects are listed as icons and arrows indicate the
messages being passed between them.
The numbers next to the messages are called
sequence numbers.
As the name suggests, they show the sequence of
the messages as they are passed between the
objects.
A simple 1, 2, 3... format can be used, as the example
below shows, or for more detailed and complex
diagrams a 1, 1.1 ,1.2, 1.2.1... scheme can be used.
Illustration
State Diagrams
State diagrams are used to describe the behavior
of a system. State diagrams describe all of the
possible states of an object as events occur. Each
diagram usually represents objects of a single
class and tracks the different states of its objects
through the system.
State Diagrams
Objects have behaviors and state.
The state of an object depends on its current
activity or condition.
A state diagram shows the possible states of the
object and the transitions that cause a change in
state.
When to use State Diagrams?
to demonstrate the behavior of an object through
many use cases of the system
use state diagrams for classes where it is necessary to
understand the behavior of the object through the
entire system.
Not all classes will require a state diagram and state
diagrams are not useful for describing the collaboration of
all objects in a use case.
Usually combined with other diagrams such as interaction
diagrams and activity diagrams.
How to Draw State Diagrams?
Basic Elements:
rounded boxes representing the state of the object
arrows indicting the transition to the next state.