Unified Modeling Language - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

Unified Modeling Language

Description:

One of the most important steps in OO problem solving is the construction of a model. ... 'A patient calls the clinic to make an appointment for a yearly checkup. ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 41
Provided by: mathew
Learn more at: http://www.cs.ucf.edu
Category:

less

Transcript and Presenter's Notes

Title: Unified Modeling Language


1
Unified Modeling Language
  • A common vocabulary for talking about software
    design

2
Models
  • One of the most important steps in OO problem
    solving is the construction of a model.
  • The model abstracts the essential details of the
    underlying problem from its usually complicated
    real world.
  • The domain is the actual world from which the
    problem comes.
  • Models consist of objects interacting by sending
    messages.

3
The Importance Of UML
  • UML provides tools for modeling problems in order
    to create software.
  • UML provides a common vocabulary to the
    participants in the problem solving (whether a
    business analyst, designer, or programmer).

4
UML Breakdown
  • UML actually consists of several tools
  • Use case diagrams
  • Class diagrams
  • Object diagrams
  • Sequence diagrams
  • Collaboration diagrams
  • Statechart diagrams
  • Activity diagrams
  • Component diagrams
  • Deployment diagrams

5
Use Case Diagrams
  • Use case diagrams depict the system from an
    external observers perspective.
  • They describe what the system does rather than
    how.
  • A scenario describes what happens when someone
    interacts with the system.
  • Example 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.
  • A use case is a summary of scenarios for a single
    task.

6
Use Case Diagrams
  • Use case diagrams consist of
  • Actors
  • Use cases
  • Communications
  • An actor is who or what initiates the events in a
    task.
  • A communication association (or simply a
    communication) is a connection between actors and
    use cases.

7
Example Use Case Diagram
Figure 1 Simple use case diagram
Figure 2 More complicated use case diagram
8
Use Case Diagrams
  • Use case diagrams are helpful in
  • determining features new use cases generate new
    requirements
  • communicating with clients simple notation can
    be understood by non-technical people
  • generating test cases the scenarios suggest
    tests that can verify correct behavior

9
Class Diagrams
  • Class diagrams show the classes in the system and
    their relationships.
  • Class diagrams are staticthey display who
    interacts but not how they interact.
  • A class in UML is shown as a rectangle divided
    into three parts class name, attributes, and
    operations.

10
Class Diagrams
Customer
class name
name address
attributes
getName
operations
11
Example Class Diagram
Figure 3 Customer order example
12
Class Diagrams
  • Class diagrams can describe the following
    relationships
  • association an association exists between two
    classes if an instance of one class must know
    about the other to perform its work.
  • aggregation an association in which one class
    belongs to a collection.
  • generalization inheritance

13
Associations
  • An association has two ends. One end may have a
    role name to clarify the relationship.
  • A navigability arrow on an association shows the
    direction the association can be traversed.
  • Multiplicity of an association end is the number
    of possible instances of the class associated
    with a single instance of the other end.

14
Common Multiplicities
Multiplicities Meaning
0..1 zero or one instance
0.. or no limit on the number of instances (including none)
1 exactly one instance
1.. at least one instance
15
Composition Aggregation
  • Associations in which an object is part of a
    whole are aggregations.
  • Composition is a strong association in which the
    part can belong to only one wholethe part cannot
    exist without the whole.
  • Composition is denoted by a filled diamond at the
    whole end.

16
Example Composition
Figure 4 Composition example
17
Visibility
  • Visibility (private, public, protected) can also
    be shown in class diagrams.
  • Static members are underlined.
  • Operations have the form
  • ltaccess specifiergt ltnamegt ( ltparameter listgt)
    ltreturn typegt
  • The parameter list shows each parameter type
    preceded by a colon.

18
Visibility
Symbol Access
public
- private
protected
19
Example Visibility
Figure 5 Visibility example
20
Interfaces
  • Interfaces can be shown in two ways
  • shown similar to regular classes
  • shown as lollipops or circles shows less
    detail
  • Both notations use the inheritance arrow.

21
Example Interface (1st notation)
Figure 6 Interfaces
22
Example Interface (2nd notation)
Figure 7 Lollipop notation
23
Object Diagrams
  • Object diagrams show instances instead of
    classes. They are especially useful in
    describing recursive relationships.
  • Each rectangle in the diagram corresponds to a
    single instance.
  • Rectangles are labeled instanceNameclassName.

24
Example Object Diagram
Figure 8 Class diagram
Figure 9 Object diagram (instantiation of above
class diagram)
25
Interaction Diagram
  • Interaction diagrams are dynamicthey describe
    how objects collaborate.
  • There are two kinds of interaction diagrams
  • sequence diagrams
  • collaboration diagrams

26
Sequence Diagrams
  • A sequence diagrams shows what messages are sent
    to whom and when.
  • They are organized according to time.
  • Time progresses down the page.
  • Objects are displayed left to right as they
    become relevant.

27
Example Sequence Diagram
Figure 10 Making a hotel reservation
28
Sequence Diagrams
  • Each vertical dotted line is a lifeline
    representing the time the object exists.
  • Each arrow is a message call.
  • The arrows go from the sender to the top of the
    activation bar of the receiver.
  • Activation bars represent the duration of the
    message.
  • All UML diagrams can contain notes dog-eared
    rectangles containing clarifying text.
  • Conditions are in square brackets.

29
Collaboration Diagrams
  • Collaboration diagrams focus on object roles
    rather than times that messages are sent.
  • Each message in a collaboration diagram has a
    seqence number. The top-level message is
    numbered 1.
  • Messages at the same level (sent during the same
    call) have the same prefix but with consecutive
    suffixes according to when they occur.

30
Example Collaboration Diagram
Figure 11 Collaboration diagram for hotel
reservation
31
Statechart Diagrams
  • A statechart diagram depicts the possible states
    an object can be in and the transitions that
    change states.
  • States are rounded rectangles.
  • Transitions are arrows.
  • Events or conditions that trigger transitions are
    written beside the arrows.
  • Initial state is solid black circle.
  • Final states are concentric white/black circles.

32
Example Statechart Diagram
Figure 12 Online banking login
33
Statechart Diagrams
  • An action that occurs as a result of an event or
    condition is expressed as /action.
  • Actions can occur inside states too. The enter,
    do, and exit events on a state trigger actions
    when the state is entered, once inside, and
    exited respectively.

34
Activity Diagrams
  • Activity diagrams are fancy flowcharts.
  • Activity diagrams focus on the flow of activities
    involved in a single process.
  • Activities are rounded rectangles.

35
Example Activity Diagram
Figure 13 Withdrawing money from a bank account
through an ATM
36
Activity Diagrams
  • Swimlanes divide activities according to who
    performs them.
  • A transition may branch into two or more mutually
    exclusive transitions.
  • Guard expressions label transitions leaving a
    branch.
  • A merge brings together multiple transitions
    (those created in the branch).
  • A fork denotes parallel execution.
  • A join is where parallel execution meets up.
    (One waits on another to complete before
    continuing).

37
Component And Deployment Diagrams
  • A component is a code module.
  • Components are shown as rectangles with two tabs
    at upper left.
  • Deployment diagrams show the physical
    configurations of software and hardware.
  • Physical hardware is made up of nodes.
  • Each components belongs on a node.

38
Example Deployment Diagram
Figure 14 Real estate transactions
39
UML Tools
  • Software exists for UML creation.
  • Some software can synchronize UML diagrams and
    code.
  • Some software can generate code once UML diagram
    is completed.
  • Rational Rose is currently the most popular
    software for UML creation.

40
Works Cited
  • Practical UML A Hands-On Introduction for
    Developers. http//www.togethersoft.com/services/
    practical_guides/umlonlinecourse/
Write a Comment
User Comments (0)
About PowerShow.com