29
Computer Engineering Department Object Oriented Software Modeling and Design CE 350 Abdel-Karim Al-Tamimi, Ph.D. [email protected] http:// faculty.yu.edu.jo/ altamimi Al-Tamimi 2011 © 1

Lecture09

Embed Size (px)

DESCRIPTION

Dynamic Analysis Technique

Citation preview

Page 1: Lecture09

Computer Engineering Department

Computer Engineering Department

Object Oriented Software Modeling and Design

CE 350Abdel-Karim Al-Tamimi, Ph.D.

[email protected]://faculty.yu.edu.jo/

altamimi

Al-Tamimi 2011 © 1

Page 2: Lecture09

Overview

• Dynamic Analysis Technique

Al-Tamimi 2011 © 2

Page 3: Lecture09

Dynamic Analysis Technique

• Three steps for developing sequence diagram:– Modeling External System Behaviors– Modeling Communication among the

Subsystems– Developing Reusable

Model/View/Control (MVC) Software Framework

Al-Tamimi 2011 © 3

Page 4: Lecture09

Modeling External System Behavior

• As the flow of events in the use-case description only records the external behaviors of the system, identifies the user inputs and system responses from the flow of events of a scenario, it is a straightforward process to map the scenario to a system-level sequence diagram

• In fact, this mapping process can be automated by a UML CASE tool

Al-Tamimi 2011 © 4

Page 5: Lecture09

Modeling Communications Among Subsystems

• Modeling and analyzing complex systems often involve many objects even for the realization of a single use case

• To develop a detailed sequence diagram based on the system-level sequence diagram with sufficient information for implementation in one go generally requires a lot of effort

• In order to manage the complexity associated with large and complex systems, it is advantageous to package objects into several subsystems

• For example, an ATM system may be organized as a number of subsystems like the ATM, the bank consortium and the bank. Such an organization also reflects how the real-world hardware and software systems are configured, since the ATMs are connected to the bank consortium’s system which is in turn connected to the systems of individual banks

Al-Tamimi 2011 © 5

Page 6: Lecture09

Modeling Communications Among Subsystems

Al-Tamimi 2011 © 6

Page 7: Lecture09

Modeling Communications Among Subsystems

Al-Tamimi 2011 © 7

Page 8: Lecture09

Developing Reusable Model/View/Control (MVC) Software

Framework• At this point you will have developed the

system-level sequence diagram and may have also developed a subsystem-level sequence diagram

• We should then develop a detailed sequence diagram in three tiers, involving three types of objects: boundary, control and entity objects

Al-Tamimi 2011 © 8

Page 9: Lecture09

The Dynamic Modeling and Analysis Process

• Developing use case scenarios• Developing system-level sequence

diagrams• Developing subsystem-level sequence

diagrams (optional for simple system)• Developing subsystem-level state chart

diagrams (optional for simple system)• Developing three-tier sequence diagrams• Developing three-tier collaboration

diagrams (optional)• Developing a state chart diagram for each

of these active (control) objects

Al-Tamimi 2011 © 9

Page 10: Lecture09

The Dynamic Modeling and Analysis Process

Al-Tamimi 2011 © 10

Use Case Model

Use Case Description

Use 1

Flow of Events:

1. event 1;2. event 2;3. ......N. etc.

Flow of EventsActor input System Responseinput1 response 1input 2 response 2 response 3input 3 .....

Use Case Description

Refined Flow of Events

Page 11: Lecture09

The Dynamic Modeling and Analysis Process

Al-Tamimi 2011 © 11

System-LevelSequence Diagram

Subsystem-Level State Diagram

Subsystem-LevelSequence Diagram

Flow of EventsActor input System Responseinput1 response 1input 2 response 2 response 3input 3 .....

Refined Flow of Events

Page 12: Lecture09

The Dynamic Modeling and Analysis Process

Al-Tamimi 2011 © 12

Subsystem-Level State Diagram

State Machine for Elaborating the Control Object

3-TierSequence Diagram

3-Tier Collaboration Diagram

Page 13: Lecture09

Developing Use Case Scenarios

Example: ATM System• Flow of Events – User inserts card– System prompts user to enter PIN– User enters PIN– System prompts user to select services– User selects service - withdraw money– System prompts user to enter withdrawal amount– User enters withdrawal amount– System displays “withdrawal successful” message,

ejects card and dispenses money– User collects card and money

Al-Tamimi 2011 © 13

Page 14: Lecture09

Developing System Level Sequence Diagram

Al-Tamimi 2011 © 14

Flow of EventsActor Input System Response

User inserts card

System prompts user to enter PIN

User enters PIN

System prompts user to select services

User selects “withdraw money” service

System prompts user to enter the amount

User enters the withdrawal amount

System displays “withdrawal successful” message, ejects card and dispenses money

User collects the card and money

Page 15: Lecture09

Developing System Level Sequence Diagram

Al-Tamimi 2011 © 15

Page 16: Lecture09

Developing Subsystem Level Sequence Diagram

Al-Tamimi 2011 © 16

Page 17: Lecture09

Developing Subsystem Level State Diagram

• With the subsystem-level sequence diagram created in Step 2, we can develop the subsystem-level state diagram for the scenario

• Let us again use the ATM as an example. When the ATM is idle, it shows a main screen, for example, the welcome screen. If the user inserts a valid ATM card, it will display a “wait for input PIN” screen

Al-Tamimi 2011 © 17

Page 18: Lecture09

Developing Subsystem Level State Diagram

(Screen Object)

Al-Tamimi 2011 © 18

Initial stateStep 0

Step 7

Step 1

Step 4

Step 6 Step 5

Step 3

Step 2

Page 19: Lecture09

Developing 3-Tier Sequence Diagram

• Identify Boundary, Control and Entity Objects – Message to and from the actor =>

boundary objects • e.g. insert card => card reader

– Information retrieval/ update => entity object

• e.g. verify card => account– Management of transactions =>

control objects • e.g. ATM controller

Al-Tamimi 2011 © 19

Page 20: Lecture09

Developing Subsystem Level State Diagram

Al-Tamimi 2011 © 20

Page 21: Lecture09

Developing Subsystem Level State Diagram

Al-Tamimi 2011 © 21

Page 22: Lecture09

Developing Subsystem Level State Diagram

Al-Tamimi 2011 © 22

Page 23: Lecture09

Developing Subsystem Level State Diagram

Al-Tamimi 2011 © 23

Page 24: Lecture09

Al-Tamimi 2011 © 24

Page 25: Lecture09

Tips and Tricks

Al-Tamimi 2011 © 25

Page 26: Lecture09

View Alignment between Sequence Diagram and State

Diagram

Al-Tamimi 2011 © 26

Page 27: Lecture09

Refining Class Diagram Using MVC-Level Scenario

Analysis• Creating Cohesive and Self-sufficient

Subsystems– Subsystems may be considered as the next level of

abstraction down from the entire system – Ideally, a subsystem should be a cohesive and

independent part of the complex system, so as to bring out the benefits of portability, reusability and maintainability

– A cohesive and independent subsystem is loosely coupled with other subsystems, and data coupling is the most loosely-coupled communication method between entities

Al-Tamimi 2011 © 27

Page 28: Lecture09

Al-Tamimi 2011 © 28

Page 29: Lecture09

Resources

• Chapter 4, Object-Oriented Technology: From diagram to code with Visual Paradigm for UML, and its slides

Al-Tamimi 2011 © 29