object oriented modeling using uml 2 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Object-Oriented Modeling Using UML (2) PowerPoint Presentation
Download Presentation
Object-Oriented Modeling Using UML (2)

Loading in 2 Seconds...

play fullscreen
1 / 30

Object-Oriented Modeling Using UML (2) - PowerPoint PPT Presentation


  • 114 Views
  • Uploaded on

Object-Oriented Modeling Using UML (2). CS 3331 Fall 2009. Outline. Modeling dynamic behavior Statechart diagram Sequence diagram Modeling requirements Use case diagram. Modeling Dynamic Behavior. Statechart diagram Depicts the flow of control using states and transitions

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

Object-Oriented Modeling Using UML (2)


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
outline
Outline
  • Modeling dynamic behavior
    • Statechart diagram
    • Sequence diagram
  • Modeling requirements
    • Use case diagram
modeling dynamic behavior
Modeling Dynamic Behavior
  • Statechart diagram
    • Depicts the flow of control using states and transitions
    • Generalization of finite state machines
  • Sequence diagram
    • Depicts object interaction by highlighting the time ordering of method invocations
statechart diagram

On

Off

Statechart Diagram
  • Graph representing finite state machine
  • Network of states and transitions
  • Good for modeling reactive systems

push switch

push switch

elements of statechart
Elements of Statechart

Final State

Initial State

Transition

Running

Idle

State

state
State
  • Condition or situation in the life of a system (or object) during which it:
    • Satisfies some condition,
    • Performs some activity, or
    • Waits for some events.
  • Set of values of properties that affect the behavior of the system (or object).
    • Determines response to an event,
    • Thus, different states may produce different responses to the same event
transition
Transition
  • Relationship between two states indicating that a system (or object) in the first state will:
    • Perform certain actions and
    • Enter the second state when specified event occurs and specified condition is satisfied.
  • Consists of:
    • Source and target states
    • Optional event, guard condition, and action

Event [Condition] / Action

Target

Source

definition
Definition
  • Event
    • An occurrence of a stimulus that can trigger a state transition
    • Instantaneous and no duration
  • Action
    • An executable atomic computation that results in a change in state of the model or the return of a value
example
Example

dial digit(n)

[incomplete]

Ringing

connected

Connecting

Dialing

dial digit(n)

[valid] / connect

dial digit(n)

[invalid]

busy

Busy

Invalid

another example
Another Example

recovery success

recovery failure

Recovery

Identification

anomaly

Normal

temperature

pressure

recovery

failure

Pressure

Recovery

Temperature

Recovery

recovery

success

recovery

failure

recovery success

composite states
Composite States

Recovery

anomaly

Recovery

Identification

Normal

recovery

success

temperature

pressure

Pressure

Recovery

Temperature

Recovery

recovery

failure

composite states cont
Composite States (Cont.)
  • Used to simplify diagrams
  • Inside, looks like statechart
  • May have composite transitions
  • May have transitions from substates
  • Sequential and parallel
composites and transitions
Composites and Transitions

Transition to/from composite state

Active

Idle

Validating

Processing

Selecting

Maintenance

Printing

Transition from substate

including composite states

Start

entry / start dial tone

exit / end dial tone

Dial Number

Include / Dialing

Partial Dialing

entry / number.append(n)

Including Composite States

Dialing

[number.isValid()]

digit(n)

digit(n)

parallel composition

Superstate

substate1

substate2

substate3

substate4

Parallel Composition
  • Concurrency (split of control)
  • Synchronization
example16
Example

Incomplete

HW1

HW2

Passed

Project

fail

Midterm

Final

Failed

group exercise cellular phone
Group Exercise: Cellular Phone
  • Draw a statechart describing the operation of a cellular phone. Assume that the cellular phone has keys for:
    • power on and off
    • keypad locking and unlocking
    • 0-9, #, and *
    • talk (or send) and end

Model at least the following operations:

    • power on/off
    • keypad locking/unlocking
    • making calls (e.g., dialing, connecting, talking),
    • receiving calls (e.g., ringing, talking)
outline18
Outline
  • Modeling dynamic behavior
    • Statechart diagram
    • Sequence diagram
  • Modeling requirements
    • Use case diagram
sequence diagram
Sequence Diagram
  • Describes a sequence of method calls among objects
  • Highlights the time ordering of method calls
example20

object

control

lifetime

message

Example
outline24
Outline
  • Modeling dynamic behavior
    • Statechart diagram
    • Sequence diagram
  • Modeling requirements
    • Use case diagram
modeling requirements
Modeling Requirements
  • Use case diagram
    • Describes the externally observable behavior of system functions, usually to define system requirements
    • Describes interactions between the system and external entities
example goldmine

Check

Grades

Validate User

Register

Student

Example: Goldmine

system

boundary

use case

actor

<<include>>

elements of use case diagram
Elements of Use Case Diagram
  • Actor:
    • represents a role played by external entities that interact with the system
  • Use case:
    • Describes what the system does (i.e., functionality)
    • Scenario: sequence of interactions between the actors and the system
  • Relationship:
    • Extension (or generalization) among actors
    • Association between actors and use cases
    • Dependency among use cases: include and extend
example goldmine cont

Student

Faculty

User

Student

Faculty

User

Enter Grades

Validate User

Check Grades

Get Roster

Register

Example: Goldmine (Cont.)

<<include>>

<<include>>

<<extend>>

use case scenarios

Use Case: Check Grades

Description: View the grades of a specific year and semester

Actors: Student

Precondition: The student is already registered

Main scenario:

User System

1. The system carries out “Validate User”, e.g.,

for user “miner” with password “allAs”.

2. The system prompts for the year and semester.

4. The system displays the grades of the courses

taken in the given semester, i.e., Fall 2007.

3. The user enters the year and

semester, e.g., Fall 2007.

Alternative:

The student enters “All” for the year and semester, and the system displays

grades of all courses taken so far.

Exceptional:

The “Validate User” use case fails; the system repeats the validation use case.

Use Case Scenarios
group exercise e book store
Group Exercise: E-book Store

Identify the main actors and the key use cases for an e-bookstore, and draw a use case diagram. Describe the use case scenario for the most important use case.

The core requirements of the e-bookstore are to allow its customers to browse and order books, music CDs, and computer software through the Internet. The main functionalities of the system are to provide information about the titles it carries to help customers make purchasing decisions; handle customer registration, order processing, and shipping; and support management of the system, such as adding, deleting, and updating titles and customer information.