23 Action-Oriented Design Methods

32
Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl für Softwaretechnologie 23 Action-Oriented Design Methods Prof. Dr. U. Aßmann Technische Universität Dresden Institut für Software- und Multimediatechnik http://st.inf.tu-dresden.de Version 11-0.1, 28.12.11 1. Use Cases 2. Structured Analysis/Design (SA/SD) 3. Structured Analysis and Design Technique (SADT)

Transcript of 23 Action-Oriented Design Methods

Page 1: 23 Action-Oriented Design Methods

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl für Softwaretechnologie

23 Action-Oriented Design Methods

Ø Prof. Dr. U. Aßmann Ø Technische Universität Dresden Ø Institut für Software- und Multimediatechnik Ø http://st.inf.tu-dresden.de Ø Version 11-0.1, 28.12.11

1. Use Cases 2. Structured Analysis/Design

(SA/SD) 3. Structured Analysis and Design

Technique (SADT)

Page 2: 23 Action-Oriented Design Methods

Obligatory Reading

Ø  Balzert, Kap. 14 Ø  Ghezzi Ch. 3.3, 4.1-4, 5.5 Ø  Pfleeger Ch. 4.1-4.4, 5

Prof. U. Aßmann Action Oriented Design

Page 3: 23 Action-Oriented Design Methods

Secondary Literature

Ø  Usually, action-oriented design is structured, i.e., based on hierarchical stepwise refinement.

Ø  Resulting systems are Ø  reducible, i.e., all results of the graph-reducibility techniques apply. Ø  Often parallel, because processes talk with streams

Ø  SA and SADT are important for embedded systems because resulting systems are parallel and hierarchic

Prof. U. Aßmann Action Oriented Design

Page 4: 23 Action-Oriented Design Methods

23.1 ACTION-ORIENTED DESIGN

Prof. U. Aßmann Action Oriented Design

Page 5: 23 Action-Oriented Design Methods

23.1 Action-oriented Design

Ø  Action-oriented design is similar to function-oriented design, but admits that the system has states. Ø  It asks for the internals of the system Ø  Actions require state on which they are performed (imperative, state-

oriented style)

Ø  Divide: finding subactions Ø  Conquer: grouping to modules and processes

Ø  Example: all function-oriented design methods can be made to action-oriented ones, if state is added

Prof. U. Aßmann Action Oriented Design

What are the actions the system should perform?

Page 6: 23 Action-Oriented Design Methods

23.2 ACTION-ORIENTED DESIGN WITH SA/SD

Data-flow connects processes (parallel actions)

Prof. U. Aßmann Action Oriented Design

Page 7: 23 Action-Oriented Design Methods

Structured Analysis and Design (SA/SD)

Ø  [DeMarco, T. Structured Analysis and System Specification, Englewood Cliffs: Yourdon Press, 1978]

Ø  Representation Ø  Function trees (action trees, process trees): decomposition of system

functions Ø  Data flow diagrams (DFD), in which the actions are called processes Ø  Data dictionary (context-free grammar) describes the structure of the

data that flow through a DFD Ø  Pseudocode (minispecs) describes central algorithms Ø  Decision Table and Trees describes conditions (see later)

Prof. U. Aßmann Action Oriented Design

Page 8: 23 Action-Oriented Design Methods

Structured Analysis and Design (SA/SD) – The Process

Ø  On the highest abstraction level: Ø  Elaboration: Define interfaces of entire system by a top-level function

tree Ø  Elaboration: Identify the input-output streams most up in the function

hierarchy Ø  Elaboration: Identify the highest level processes Ø  Elaboration: Identify stores

Ø  Refinement: Decompose function tree hierarchically Ø  Change Representation: transform function tree into process

diagram (action/data flow) Ø  Elaboration: Define the structure of the flowing data in the Data

Dictionary Ø  Check consistency of the diagrams Ø  Elaboration: Minispecs (pseudocode)

Prof. U. Aßmann Action Oriented Design

Page 9: 23 Action-Oriented Design Methods

Prof. U. Aßmann Action Oriented Design

Page 10: 23 Action-Oriented Design Methods

Function Trees (Action Trees) and DFDs

Ø  Function trees are homomorphic to DFD Ø  RepresentationChange: Construct a function tree and transform it

to the actions of a DFD

Prof. U. Aßmann Action Oriented Design

produce tea

put tea in pot

add boiling water

wait

composition put tea in pot

add boiling water

wait

produce tea

Pot store/file

action

Cup

fetch tea from tea box

open pot

close pot

Page 11: 23 Action-Oriented Design Methods

Decomposition of DFDs and Actions

Ø  Subtrees in the function tree lead to reducible subgraphs in the DFD

Prof. U. Aßmann Action Oriented Design

Fetch tea from tea box

Open pot

Close Pot

put tea in pot

Pot

Pot

put tea in pot

Pot

put tea in pot

fetch tea from tea box

open pot

close pot

Page 12: 23 Action-Oriented Design Methods

Data Flow in UML

Ø  UML function trees can be formed from actions, and aggregation Ø  Activity diagrams can specify dataflow

Ø  UML 2.0 offers reducible activity diagrams

Prof. U. Aßmann Action Oriented Design

Fetch tea from tea box

Open pot

Close Pot

put tea in pot

Pot

put tea in pot

Pot

put tea in pot

open pot

Pot

close pot

fetch tea from tea box

Page 13: 23 Action-Oriented Design Methods

Prof. U. Aßmann Action Oriented Design

Page 14: 23 Action-Oriented Design Methods

Typing Edges with Types from the Data Dictionary

Ø  In an SA model, the data dictionary describes the context free structure of the data flowing over the edges Ø  For every edge in the DFDs, it contains a context-free grammar that

describes the flowing data items Ø  Notation is also called Extended Backus-Naur Form (EBNF)

Prof. U. Aßmann Action Oriented Design

Notation Meaning Example ::= or = Consists of A ::= B. Sequence + Concatenation A ::= B+C. Sequence <blank> Concatenation A ::= B C. Selection [ | ] Alternative A ::= [ B | C ]. Repetition { }^n A ::= { B }^n. Limited repetition m { } n Repetition from m to n A ::= 1{ B }10. Option ( ) Optional part A ::= B (C).

Page 15: 23 Action-Oriented Design Methods

Example Data Dictionary

Prof. U. Aßmann Action Oriented Design

DataInPot ::= TeaPortion WaterPortion. TeaAutomatonData ::= Tea | Water | TeaDrink. Tea ::= BlackTea | FruitTea | GreenTea. TeaPortion ::= { SpoonOfTea }. SpoonOfTea ::= Tea. WaterPortion ::= { Water }.

Page 16: 23 Action-Oriented Design Methods

Adding Types to DFDs

Ø  Nonterminals from the data dictionary become types on flow edges Ø  (Alternatively, types from a UML class diagram can be annotated)

Prof. U. Aßmann Action Oriented Design

put tea in pot

add boiling water

wait

produce tea

Pot

Water GreenTea

Cup

TeaDrink

Page 17: 23 Action-Oriented Design Methods

Minispecs in Pseudo Code

Ø  Minispecs describes the processes in the nodes of the DFD in pseudo code. They describe the data transformation of every process

Ø  Here: specification of the minispec attachment process:

Prof. U. Aßmann Action Oriented Design

procedure: AddMinispecsToDFDNodes target.bubble := select DFD node; do while target-bubble needs refinement if target.bubble is multi-functional then decompose as required; select new target.bubble;

add pseudocode to target.bubble; else no further refinement needed endif enddo

end

Page 18: 23 Action-Oriented Design Methods

Good Languages for Pseudocode

Ø  SETL (Schwartz, New York University) Ø  Dynamic sets, mappings Ø  Iterators

Ø  PIKE (pike.ida.liu.se) Ø  Dynamic arrays, sets, relations, mappings Ø  Iterators

Ø  ELAN (Koster, GMD) Ø  Natural language as identifiers of procedures

Ø  Smalltalk (Goldberg et.al, Parc) Ø  Attempto Controlled English (ACE, Prof. Fuchs, Zurich)

Ø  A restricted form of English, easy to parse

Prof. U. Aßmann Action Oriented Design

Page 19: 23 Action-Oriented Design Methods

Structured Analysis and Design (SA/SD) - Heuristics

Ø  Consistency checks Ø  Several consistency rules between diagrams (e.g., between function trees

and DFD) Ø  Corrections necessary in case of structure clash between input and output

formats Ø  Advantage of SA

Ø  Hierarchical refinement: The actions in the DFD can be refined, I.e., the DFD is a reducible graph

Ø  SA leads to a hierarchical design (a component-based system)

Prof. U. Aßmann Action Oriented Design

Page 20: 23 Action-Oriented Design Methods

Difference to Functional and Modular Design

Ø  SA focusses on actions (activities, processes), not functions Ø  Describe the data-flow through a system Ø  Describe stream-based systems with pipe-and-filter architectures

Ø  Actions are processes Ø  SA and SADT can easily describe parallel systems

Ø  Function trees are interpreted as action trees (process trees) that treat streams of data

Prof. U. Aßmann Action Oriented Design

Page 21: 23 Action-Oriented Design Methods

Result: Data-Flow-Based Architectural Style

Ø  SA/SD design leads to dataflow-based architectural style Ø  Processes exchanging streams of data Ø  Data flow forward through the system Ø  Components are called filter, connections are pipes

Prof. U. Aßmann Action Oriented Design

Filter Filter

Filter

System pipe

pipe

Page 22: 23 Action-Oriented Design Methods

Examples

Ø  Shell pipes-and-filters Ø  Image processing systems Ø  Signal processing systems (DSP-based embedded systems)

Ø  The satellite radio Ø  Video processing systems Ø  Car control Ø  Process systems (powerplants, production control, …)

Ø  Content management systems (CMS)

Prof. U. Aßmann Action Oriented Design

Page 23: 23 Action-Oriented Design Methods

23.3 SADT

Prof. U. Aßmann Action Oriented Design

Page 24: 23 Action-Oriented Design Methods

Structured Analysis and Design Technique (SADT)

Ø  SADT is a action- and data-flow-oriented method Ø  Reducible graphs with 2 main forms of diagrams:

Ø  Activity diagrams: Nodes are activities, edges are data flow (like DFD) Ø Data flow architectures result

Ø  Data diagrams: Nodes are data (stores) and edges are activities Ø  Layout constraint: edges go always from left to right, top to bottom

Ø  Companies used to have standardized forms, marked with author, date, version, name, etc..

Prof. U. Aßmann Action Oriented Design

Activity Input Data

Output Data

Control Data

Mechanism/ responsible

Data Generating Activity

Consuming Activity

Control Activity

Store

Page 25: 23 Action-Oriented Design Methods

Maintenance

Example: The Waterfall Software Model with Activity Diagram of SADT

Ø  Activity Diagrams SADT – Similar to DFD Ø  Read direction left to right, top to bottom Ø  With designation of responsible

Prof. U. Aßmann Action Oriented Design

Collect Requirements

Design

Designer Implementation

Requirements Engineer

Programmer

Maintener

Waterfall Software Construction

SRS

SD

Program

Page 26: 23 Action-Oriented Design Methods

Refinement of Nodes

Prof. U. Aßmann Action Oriented Design

Architectural Design

Detailed Design

Designer

Architect

Design

Detailed Design Document

Architectural Design

Requirements

Page 27: 23 Action-Oriented Design Methods

Data Diagrams SADT

Prof. U. Aßmann Action Oriented Design

Characters

Tokens

Syntax Tree

Intermediate Code

Machine code

Buffer

Pipe

Memory

File

Lex. Grammar Grammar Tree Mapping

Compiler

Page 28: 23 Action-Oriented Design Methods

Prof. U. Aßmann Action Oriented Design

Page 29: 23 Action-Oriented Design Methods

Comparison SADT vs SA/SD

Ø  SADT, SA/SD are system-oriented methods, known in other disciplines Ø  Action-oriented methods

Ø  they only distinguish between actions (processes) and data Ø  Stream-oriented, i.e., model streams of data flowing through the system Ø  System-oriented, know the concept of a subsystem

Ø  SA-DFDs are more flexible as SADT actitity diagrams, since the layout is not constrained Ø  Function trees and DDs may be coupled with SADT

Prof. U. Aßmann Action Oriented Design

Page 30: 23 Action-Oriented Design Methods

Why are SA and SADT Important?

Ø  They lead to component-based systems (hierarchical systems) Ø  Component-based systems are ubiquituous for many areas Ø  Object-orientation is not needed everywhere Ø  Other engineers use SADT also

Ø  SA and SADT can easily describe parallel systems in a structured way

Ø  SA and SADT are stream-based, i.e., for stream-based applications. When your context model has streams in its interfaces, SA and SADT might be applicable

Ø  Use case actions can be refined similarly as SA and SADT actions!

Prof. U. Aßmann Action Oriented Design

Page 31: 23 Action-Oriented Design Methods

What Have We Learned

Ø  Use case diagrams are an action-oriented diagram notation Ø  that can be coupled with several design methods (action trees,

communication diagrams) Ø  Besides object-oriented design, structured, action-oriented design

is a major design technique Ø  It will not vanish, but always exist for certain application areas Ø  If the system will be based on stream processing, system-oriented design

methods are appropriate Ø  System-oriented design methods lead to reducible systems

Ø  Don't restrict yourself to object-oriented design

Prof. U. Aßmann Action Oriented Design

Page 32: 23 Action-Oriented Design Methods

The End

Prof. U. Aßmann Action Oriented Design