+ All Categories
Home > Documents > Chapter 5 – System Modeling Lecture 3 When the words are fuzzy, the programmers reflexively...

Chapter 5 – System Modeling Lecture 3 When the words are fuzzy, the programmers reflexively...

Date post: 25-Dec-2015
Category:
Upload: jason-summers
View: 216 times
Download: 0 times
Share this document with a friend
Popular Tags:
18
Chapter 5 – System Modeling Lecture 3 When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available: source code. Although there is nothing more precise than code, there is also nothing more permanent or resistant to change. So the situation frequently crops up where nomenclature confusion drives programmers to begin coding prematurely, and that code becomes the de facto design, regardless of its appropriateness or correctness. A. Cooper (in "The Inmates are Running the Asylum") 1 Chapter 5 System modeling
Transcript
Page 1: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Chapter 5 – System Modeling

Lecture 3 When the words are fuzzy, the programmers reflexively retreat to the most precise

method of articulation available: source code. Although there is nothing more precise than code, there is also nothing more permanent or resistant to change. So the situation frequently crops up where nomenclature confusion drives programmers to begin coding prematurely, and that code becomes the de facto design, regardless of its appropriateness or correctness.

A. Cooper (in "The Inmates are Running the Asylum")

1Chapter 5 System modeling

Page 2: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Topics covered

Context models

Interaction models

Structural models

Behavioral models

Model-driven engineering

2Chapter 5 System modeling

Page 3: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Behavioral models

models of the dynamic behavior of a system as it is executing. They show what happens or what is supposed to happen when

a system responds to a stimulus from its environment.

You can think of these stimuli as being of two types: Data. Some data arrives that has to be processed by the

system. Events. Some event happens that triggers system processing.

• Events may have associated data, although this is not always the case.

3Chapter 5 System modeling

Page 4: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Data-driven modeling

Many business systems are data-processing systems that are primarily driven by data. controlled by the data input to the system relatively little external event processing.

Data-driven models show the sequence of actions involved in processing input data and generating an associated output.

useful during the analysis of requirements can be used to show end-to-end processing in a system.

4Chapter 5 System modeling

Page 5: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Data Driven Modeling

Three types of models are commonly used

Data flow diagrams• track how data moves through a system• Focus on system functions and do not recognize system objects• Cannot be used with UML because UML focuses on objects

Actviity diagrams• Used in UML• Similar to DFD• Represent processing steps as objects• Shows flow of data between steps (or objects)

Sequence diagrams• Same as we looked at before• Only pass messages left to right• Alternative to activity diagrams for UML

Chapter 5 System modeling 5

Page 6: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

An activity model of the insulin pump’s operation

6Chapter 5 System modeling

Activity Diagram

Page 7: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Order processing

7Chapter 5 System modeling

Sequence Diagram

Page 8: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Class Collaboration Diagrams

Collaborations Another type of data-driven diagram Show system behavior Specify which elements of the class diagram must

interact to produce a particular behavior usually embodied in use case or scenario

Chapter 5 System modeling 8

Page 9: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Class Collaboration Diagrams

For each of your classes: Determine the responsibilities of the class (in detail.)

For each use case: determine if the associated scenarios can be “handled” by some

subset of the classes. If not, rethink your classes. If so, create the class collaboration diagram for that scenario

Cass diagrams vs Class Collaboration diagrams Class diagrams are about structure.

• Which classes contain an instance of another class Class Collaboration diagrams are about behavior

• Which classes pass messages to other classes

Chapter 5 System modeling 9

Page 10: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Class Collaboration Diagrams

Chapter 5 System modeling 10

GUI

Graphical CellListener

Player

Game Coordinator

Communicates via network

initialize

Send messages

Display messages

Display

connect

Page 11: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Event-driven modeling

Real-time systems are often event-driven, with minimal data processing. For example, a landline phone switching system responds to

events such as ‘receiver off hook’ by generating a dial tone.

Event-driven modeling shows how a system responds to external and internal events.

based on two assumptions: a system has a finite number of states events (stimuli) may cause a transition from one state to another.

Chapter 5 System modeling 11

Page 12: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

State machine models

model the behaviour of the system in response to external and internal events.

They show the system’s responses to stimuli

often used for modelling real-time systems.

12Chapter 5 System modeling

Page 13: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

State machine models

system states are nodes

events as arcs between these nodes.

When an event occurs, the system moves from one state to another.

Statecharts are an integral part of the UML and are used to represent state machine models.

13Chapter 5 System modeling

Page 14: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

State diagram of a microwave oven

14Chapter 5 System modeling

Page 15: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

States and stimuli for the microwave oven (a)

State Description

Waiting The oven is waiting for input. The display shows the current time.

Half power The oven power is set to 300 watts. The display shows ‘Half power’.

Full power The oven power is set to 600 watts. The display shows ‘Full power’.

Set time The cooking time is set to the user’s input value. The display shows the cooking time selected and is updated as the time is set.

Disabled Oven operation is disabled for safety. Interior oven light is on. Display shows ‘Not ready’.

Enabled Oven operation is enabled. Interior oven light is off. Display shows ‘Ready to cook’.

Operation Oven in operation. Interior oven light is on. Display shows the timer countdown. On completion of cooking, the buzzer is sounded for five seconds. Oven light is on. Display shows ‘Cooking complete’ while buzzer is sounding.

15Chapter 5 System modeling

Page 16: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

States and stimuli for the microwave oven (b)

Stimulus Description

Half power The user has pressed the half-power button.

Full power The user has pressed the full-power button.

Timer The user has pressed one of the timer buttons.

Number The user has pressed a numeric key.

Door open The oven door switch is not closed.

Door closed The oven door switch is closed.

Start The user has pressed the Start button.

Cancel The user has pressed the Cancel button.

16Chapter 5 System modeling

Page 17: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Microwave oven operation

17Chapter 5 System modeling

Page 18: Chapter 5 – System Modeling Lecture 3  When the words are fuzzy, the programmers reflexively retreat to the most precise method of articulation available:

Key points

Behavioral models are used to describe the dynamic behavior of an executing system. This behavior can be modeled from the perspective of the data processed by the system, or by the events that stimulate responses from a system.

Activity diagrams may be used to model the processing of data, where each activity represents one process step.

State diagrams are used to model a system’s behavior in response to internal or external events.

Model-driven engineering is an approach to software development in which a system is represented as a set of models that can be automatically transformed to executable code.

Chapter 5 System modeling 18


Recommended