Software Architecture



Similar documents
Software Engineering

Advanced Analysis and Design

Systems Integration: Co C mp m onent- t bas a e s d s o s ftw ft a w r a e r e ngin i eeri r n i g

Software Architectures

Real Time Programming: Concepts

Information Systems Analysis and Design CSC John Mylopoulos. Software Architectures Information Systems Analysis and Design CSC340

How To Develop Software

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

KWIC Implemented with Pipe Filter Architectural Style

Construction Principles and Design Patterns. Flyweight, Bridge, Builder

(Refer Slide Time: 2:03)

RTAP Database Lifecycle Management

Dynamic Adaptability of Services in Enterprise JavaBeans Architecture

KWIC Exercise. 6/18/ , Spencer Rugaber 1

Learning Module 4 - Thermal Fluid Analysis Note: LM4 is still in progress. This version contains only 3 tutorials.

Patterns in Software Engineering

MECE 102 Mechatronics Engineering Orientation

Apache Spark 11/10/15. Context. Reminder. Context. What is Spark? A GrowingStack

LAB 6 - GRAVITATIONAL AND PASSIVE FORCES

Applying 4+1 View Architecture with UML 2. White Paper

Software design (Cont.)

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Surveillance System Using Wireless Sensor Networks

SIX DEGREE-OF-FREEDOM MODELING OF AN UNINHABITED AERIAL VEHICLE. A thesis presented to. the faculty of

MANUAL FOR RX700 LR and NR

High-level Design. What is software architecture?

An Introduction to Software Architecture

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

ECEN 1400, Introduction to Analog and Digital Electronics

Complexities of Simulating a Hybrid Agent-Landscape Model Using Multi-Formalism

Vragen. Architecture presentations in practice. Some terms (from IEEE standard)

INTERFERENCE OF SOUND WAVES

imc FAMOS 6.3 visualization signal analysis data processing test reporting Comprehensive data analysis and documentation imc productive testing

PD 100A. Printing data system

Real-time Operating Systems Lecture 27.1

IR Communication a learn.sparkfun.com tutorial

Architectural Patterns. Layers: Pattern. Architectural Pattern Examples. Layer 3. Component 3.1. Layer 2. Component 2.1 Component 2.2.

Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering

Today s Outline. Computer Communications. Java Communications uses Streams. Wrapping Streams. Stream Conventions 2/13/2016 CSE 132

Basics of Digital Recording

AIRCRAFT PERFORMANCE Pressure Altitude And Density Altitude

Integrating NLTK with the Hadoop Map Reduce Framework Human Language Technology Project

PCM Encoding and Decoding:

CENTRONICS interface and Parallel Printer Port LPT

Architecture Design & Sequence Diagram. Week 7

Architecture. Reda Bendraou

Technical Information. Digital Signals. 1 bit. Part 1 Fundamentals

SIGNAL GENERATORS and OSCILLOSCOPE CALIBRATION

MSc in Autonomous Robotics Engineering University of York

Op-Amp Simulation EE/CS 5720/6720. Read Chapter 5 in Johns & Martin before you begin this assignment.

3D Interactive Information Visualization: Guidelines from experience and analysis of applications

Tutorial for Tracker and Supporting Software By David Chandler

Designing Event-Controlled Continuous Processing Systems Class 325

Software Life-Cycle Management

Vehicle data acquisition using CAN By Henning Olsson, OptimumG

Lab 8 Notes Basic Aircraft Design Rules 6 Apr 06

The evolution of DAVE

THE INPUT/OUTPUT SYSTEM. Key Points

Chapter 6, The Operating System Machine Level

The Data Warehouse ETL Toolkit

Self-Balancing Robot Project Proposal Abstract. Strategy. Physical Construction. Spencer Burdette March 9, 2007

PhidgetInterfaceKit 8/8/8

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

MYTHBUSTING Takes on Shielded Cabling

School of Computer Science

A UML Introduction Tutorial

Peter Mileff PhD SOFTWARE ENGINEERING. The Basics of Software Engineering. University of Miskolc Department of Information Technology

Complex Event Processing (CEP) Why and How. Richard Hallgren BUGS

Variable Base Interface

(Refer Slide Time 00:56)

APPENDIX 3-B Airplane Upset Recovery Briefing. Briefing. Figure 3-B.1

T0118 T2118 T3118. Instruction Manual

Mathematical Modelling of Computer Networks: Part II. Module 1: Network Coding

isim ACTIVE FILTER DESIGNER NEW, VERY CAPABLE, MULTI-STAGE ACTIVE FILTER DESIGN TOOL

Instruction Manual. T3111 T3111L T3111P T3111Ex

Spotfire v6 New Features. TIBCO Spotfire Delta Training Jumpstart

E190Q Lecture 5 Autonomous Robot Navigation

Clock Recovery in Serial-Data Systems Ransom Stephens, Ph.D.

Compliance and Requirement Traceability for SysML v.1.0a

fakultät für informatik informatik 12 technische universität dortmund Data flow models Peter Marwedel Informatik 12 TU Dortmund Germany

File Management. Chapter 12

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Digital Electronics Detailed Outline

LAB 6: GRAVITATIONAL AND PASSIVE FORCES

Welcome to this presentation on LED System Design, part of OSRAM Opto Semiconductors LED 101 series.

Operational Amplifier - IC 741

XGIG 8.5 Gb/s FIBRE CHANNEL ANALYZER High-Performance Protocol Analysis for 1.065, 2.125, 4.25, and 8.5 Gb/s Fibre Channel

A Proposal for OpenEXR Color Management

White Paper. How Streaming Data Analytics Enables Real-Time Decisions

Hardware In The Loop Simulator in UAV Rapid Development Life Cycle

System Modeling and Control for Mechanical Engineers

The Java I/O System. Binary I/O streams (ascii, 8 bits) The decorator design pattern Character I/O streams (Unicode, 16 bits)

The Service Revolution software engineering without programming languages

Computer Networks. Data Link Layer

Fourth generation techniques (4GT)

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

TCOM 370 NOTES 99-6 VOICE DIGITIZATION AND VOICE/DATA INTEGRATION

Test Driven Development of Embedded Systems Using Existing Software Test Infrastructure

Module 5. Broadcast Communication Networks. Version 2 CSE IIT, Kharagpur

Transcription:

Software Architecture Lecture 2 Data Flow Systems João Pedro Sousa George Mason University last class Software Architecture is about representing the structure of a system from different angles: views views help manage the complexity of describing the architecture viewtypes determine the kinds of things a view talks about three primary viewtypes: module, C&C, allocation some styles occur frequently within each viewtype module: decomposition, generalization, layered, C&C: pipe & filter, client-server, pub-sub allocation: deployment, work assignment Lecture 2 Data Flow Systems 2 1

today s outline data flow styles lab 1 process control batch-sequential pipe & filter case study: Tektronix pipe & filter sub-styles & implementation Acknowledgment some of the material presented in this course is adapted from 17655, taught to the MSE at CMU by David Garlan and Tony Lattanze Lecture 2 Data Flow Systems 3 in data flow styles data flow dominates structure and control a data flow system is one in which: the structure of the design is determined by the motion of data from component to component the availability of data controls the computation the pattern of data flow is explicit this is the only form of communication between components variations on this theme how control is exerted (e.g., push versus pull) degree of concurrency between processes granularity of computation topological restrictions (e.g., pipeline) Lecture 2 Data Flow Systems 4 2

data flow styles assume: connectors are data streams interfaces are reader and writer roles transport data from writer roles to reader roles unidirectional (usually asynchronous, buffered) components do not know the identity of upstream/downstream producers/consumers read data from input ports compute write data to output ports Lecture 2 Data Flow Systems 5 in data flow styles availability of data controls the computation any component that has input may process it overall data transformation is the functional composition of individual transformations s? f g h h(g(f(s))) Lecture 2 Data Flow Systems 6 3

data flow styles structure is an arbitrary graph in general, data can flow in arbitrary patterns however, frequently data flows in stages or in simple, highly constrained cyclic structures Lecture 2 Data Flow Systems 7 three major data flow styles batch sequential data flow pipe & filter process control Unix pipes process control looping structure to control environment variables batch sequential sequential processing steps, run to completion typical of early MIS applications pipe & filter incremental transformation of streams Yahoo pipes Unix pipes and Yahoo pipes are special cases (sub-styles) Lecture 2 Data Flow Systems 8 4

example of process control open-loop control system Chimney Ambient Air in Heated Air out Gas Valve Gas Line Lecture 2 Data Flow Systems 9 example of process control closed-loop control system Thermostat Chimney Ambient Air in Heated Air out Gas Line Lecture 2 Data Flow Systems 10 5

process control notions open-loop system: process variables not used to control the system closed-loop system: process variables used to control the system controlled variable: goal (ex: air temperature inside the house) set Point: value for the controlled variable input variable: what the system can measure (ex: temperature of the outside air coming into the furnace) manipulated variables: what the system can affect (ex: turning the furnace on or off) feedback control controlled variable is measured and taken into account feed-forward control process variables other than c.v. are taken into account Lecture 2 Data Flow Systems 11 architecture of closed-loop process control inputs... set point value control task manipulated values Process to Control controlled value feedback legend computation data flow Lecture 2 Data Flow Systems 12 6

example architecture heating closed-loop control outside temp desired temp control task on/off furnace temp inside the house legend computation data flow Lecture 2 Data Flow Systems 13 example architecture very simplified avionics trim pilot inputs: Roll Pitch Yaw +/- aileron ctl. process servo value altitude air speed control task +/- +/- +/- A to D conv elevator ctl. process rudder ctl. process legend +/- digital positive or negative increment analog signal Lecture 2 Data Flow Systems 14 7

three major data flow styles batch sequential data flow pipe & filter process control Unix pipes process control looping structure to control environment variables Yahoo pipes batch sequential sequential processing steps, run to completion typical of early MIS applications pipe & filter incremental transformation of streams Unix pipes and Yahoo pipes are special cases (sub-styles) Lecture 2 Data Flow Systems 15 batch sequential assumes: connectors data is transmitted as a whole between steps components processing steps are independent programs each step runs to completion before the next step starts Program Program Program... legend data flow via magnetic tape computational units Lecture 2 Data Flow Systems 16 8

examples of batch sequential systems classical data processing payroll computations IRS tax return computations tape Validate tape Sort tape Update tape Report report tape early software development environments Text Code Lex Syn Sem Opt Code Lecture 2 Data Flow Systems 17 three major data flow styles batch sequential data flow pipe & filter process control Unix pipes process control looping structure to control environment variables Yahoo pipes batch sequential sequential processing steps, run to completion typical of early MIS applications pipe & filter incremental transformation of streams Unix pipes and Yahoo pipes are special cases (sub-styles) Lecture 2 Data Flow Systems 18 9

pipe & filter assumes: connectors, called pipes: move data from a filter output to a filter input one-way, order-preserving, data-preserving system action is mediated by data delivery components, called filters: incrementally transform the input data to output data enrich data by computation and adding information refine by distilling data or removing irrelevant data transform data by changing its representation operate independently/concurrently among each other no external context in processing streams no state preservation between instantiations no knowledge of upstream/downstream filters topology determines the overall computation, not relative speed/cpu allocation of filters Lecture 2 Data Flow Systems 19 example of pipe & filter system telemetry data collection frame collection minor frame decommutation display data time tag frame measurement units record data major frame decommutation apply coefficients Lecture 2 Data Flow Systems 20 10

example P&F autonomic vehicle Lecture 2 Data Flow Systems 21 special case of the pipe & filter style Unix pipes pipes: buffered streams supported by OS assume ASCII character streams can treat files as well as filters as data sources and sinks the good news: anything can connect to anything the bad news: everything must be encoded in ASCII, if not, it must be translated before piping filters: Unix processes built-in ports: stdin, stdout, stderr filters by default transform stdin to stdout Lecture 2 Data Flow Systems 22 11

example of Unix pipes system cat /etc/passwd grep joe sort > junk passwd cat grep sort junk does this stretch any assumption of the pure pipe & filter style? Lecture 2 Data Flow Systems 23 special case of the pipe & filter style Yahoo pipes web application for authoring Yahoo pipes Yahoo pipe is a data mashup application hosted by Yahoo combine, filter, and present data from different web sources http://pipes.yahoo.com/pipes/ Lecture 2 Data Flow Systems 24 12

outline data flow styles process control batch-sequential pipe & filter case study: Tektronix lab 1 pipe & filter sub-styles & implementation Lecture 2 Data Flow Systems 25 major manufacturer of oscilloscopes Tektronix signals oscilloscope traces and measurements Lecture 2 Data Flow Systems 26 13

Tektronix had a problem (real) increasing complexity of instrumentation systems increasing role of software in products that were once largely hardware raised expectations of users separate development cultures similar products developed by different divisions little sharing build-from-scratch methods new hardware or new UI => new software products hard to develop and evolve increasingly serious bugs due to concurrency excessive time-to-market (~ 4-5 years) Lecture 2 Data Flow Systems 27 Tektronix challenge build next generation instrumentation systems allow reuse between product divisions sophisticated products in response to user desires consistent user interface across multiple hardware platforms multiple user interfaces for same platform (vertical markets) reduce time to market Lecture 2 Data Flow Systems 28 14

Tektronix tried O-O approach with mixed results created class hierarchy waveform max-min wvfm x-y wvfm accumulate wvfm waveform w: time-> voltage max: -> voltage min: -> voltage invert:... add:... result: hundreds of classes hard to organize hierarchy doesn t relate to structure of system (oscilloscope) Lecture 2 Data Flow Systems 29 next, Tektronix tried layered approach also with mixed results Hardware Digitization Visualization User interface result: designers found layer boundaries hard to enforce and unrealistic Lecture 2 Data Flow Systems 30 15

third, Tektronix tried pipe & filter with better results Signal Couple Acquire To-XY Clip Times Waveform Trace Trigger subsystem Measure Measurement result: clearly reflects design organization and features not clear how to model user input Lecture 2 Data Flow Systems 31 fourth, Tektronix tried extending p & f with parameterized filters Coupling Kind,Rate Trans Size Signal Couple Acquire To-XY Clip Times Trigger subsystem Waveform Trace Measure Measurement result: clearly reflects design organization and features models user input not directly useful for implementors Lecture 2 Data Flow Systems 32 16

fifth, Tektronix extended p & f with colored pipes Coupling Kind,Rate Trans Size Signal Couple Acquire To-XY Clip Times Trigger subsystem Waveform Trace Measure Measurement result: clearly reflects design organization and features models user input describes the nature of data and performance constraints on each pipe Lecture 2 Data Flow Systems 33 software architecture had an impact on Tektronix business architectural style was used as basis for the next generation of oscilloscope products led to highly successful framework, in which time-to-market was cut substantially reliability of products was improved user interface was extensible new thrust of research/development collaborations led to new frameworks beyond oscilloscopes Lecture 2 Data Flow Systems 34 17

take 5 Lecture 2 Data Flow Systems 35 outline data flow styles process control batch-sequential pipe & filter case study: Tektronix lab 1 recover views from the code: module, C&C pipe & filter sub-styles & implementation Lecture 2 Data Flow Systems 36 18

lab 1: pipe & filter system build avionics instrumentation systems data comes in from airplane sensors ID Data Descriptions and Units Type Number of Bytes 00 Time: number of milliseconds since the Epoch (00:00:00 GMT on January 1, 1970) long int 8 01 Velocity: airspeed of the vehicle, measured in knots per hour double 8 02 Altitude: vehicle s distance from the average surface of oceans, measured in feet double 8 03 Pressure: atmospheric pressure external to the vehicle, measured in PSI double 8 04 Temperature: temperature of the vehicle s hull, measured in degrees Fahrenheit double 8 05 Pitch: angle of the nose of the vehicle, if positive, the vehicle is climbing double 8 framed as 0000 Time 0001 Velocity n data 0000 Time 0001 Velocity n data Lecture 2 Data Flow Systems 37 lab 1: pipe & filter system build avionics instrumentation systems system A: reads flight data and converts Temp to Celsius converts altitude to meters removes other fields system B: same plus includes pressure data removes pressure outliers > 80psi or <50 psi and replaces them by interpolated values (avg of previous and next) system C: merges streams from two sets of sensors output frames are sorted by time Stream A : 10:23:21.912 10:23:23.014 10:23.25.256 : Stream B : 10:23:22.002 10:23:24.714 10:23.26.681 : Stream C : 10:23:21.912 10:23:22.002 10:23:23.014 10:23:24.714 10:23:25.256 10:23.26.681 : Lecture 2 Data Flow Systems 38 19

lab 1: pipe & filter system based on a code framework remember: module and C&C viewtypes show different aspects module view C&C view main lower split lower upper merge split merge config input/output upper Legend Module is a uses Legend Filter Pipe Lecture 2 Data Flow Systems 39 lab 1 module view Object Thread Plumber OutputStream InputStream PipedOutputStream FilterFramework PipedInputStream SourceFilter MiddleFilter SinkFilter Java lib app class extends (is a) uses Lecture 2 Data Flow Systems 40 20

lab 1 C&C view Filter1 <SourceFilter> Filter2 <MiddleFilter> Filter3 <SinkFilter> Plumber main filter (thread) pipe creates and connects the filters doesn t intervene during system operation therefore not normally represented Lecture 2 Data Flow Systems 41 why is the code written like this? a little history the Greeks had the following number system: separate letters for numbers between 1 and 9 (for example, was nine) separate letters for multiples of ten between 10 and 90 (for example, was sixty) separate letters for multiples of one hundred between 100 and 900 (for example, was 300) so 309 was written the positional system arrived in 500 AD imagine someone used to the Greek system being annoyed with having to write extra digits why is the positional system successful? Lecture 2 Data Flow Systems 42 21

outline data flow styles lab 1 process control batch-sequential pipe & filter case study: Tektronix pipe & filter sub-styles & implementation Lecture 2 Data Flow Systems 43 pipe & filter sub-styles & implementation system level topological constraints some styles insist on a pipeline, or no cycles that is, some styles are hierarchical, some aren t strategies for creation of elements centralized versus distributed static versus dynamic declarative versus operational (some systems have both) Lecture 2 Data Flow Systems 44 22

pipe & filter sub-styles & implementation components concurrency separate processes or single address space constraints on ports e.g., Unix components typically have 3 ports: stdin, stdout, stderr e.g., some styles require single input and single output port computational model e.g., how do you deal with multiple inputs? Lecture 2 Data Flow Systems 45 pipe & filter sub-styles & implementation connectors finite versus infinite buffering dealing with end of data can a writer terminate the flow of data? can a reader choose not to consume data on a pipe? what can a reader or a writer do after data has been terminated? does data have different types? how many kinds of pipes are there? (colored pipes) Lecture 2 Data Flow Systems 46 23

pipe & filter sub-styles & implementation example: Unix pipes two kinds of specification shell (ex:) infile > capitalize rem_white_space compress > outfile programmatically: use stdio library to create pipes and hook them up topology linear if from shell may have cycles if done programmatically creation static if from shell dynamic if done programmatically Lecture 2 Data Flow Systems 47 pipe & filter sub-styles & implementation example: Unix pipes filters concurrency: separate processes ports: three for shell filters computational model: filter chooses which ports to read and write (if you guess wrong deadlock may result) pipes supported by operating system buffered (e.g., 2K bytes) special end-of-file marker reader can close its end of a pipe at any time must be aware of whether input is coming from a file or a filter data has one type only: raw bytes Lecture 2 Data Flow Systems 48 24

references for implementation strategies book on Java threads Concurrent Programming in Java: Design Principles and Patterns (2nd Edition) by Doug Lea online tutorial on Java threads http://www.javaworld.com/jw-04-1996/jw-04-threads.html Design Patterns book by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides Lecture 2 Data Flow Systems 49 in summary select a data flow style when: task is dominated by the availability of data data can be moved predictably from process to process pipe-and-filter architectures are good choices for many data flow applications because they permit reuse and reconfiguration of filters generally easy to reason about reduce system testing may allow incremental AND parallel processing there may be a performance penalty when implementing data flow styles over a single process Lecture 2 Data Flow Systems 50 25

in summary styles are rarely usable in simple pure form one technique is to specialize styles styles become more constrained, domain-specific trade generality (expressiveness) for power (analytic capability) we saw this today in the examples of data flow styles data flow batch sequential pipe & filter process control Unix pipes Yahoo pipes Lecture 2 Data Flow Systems 51 in summary there are many points on the spectrum of specialization we looked at a few example today (stars) but will be looking at lots more during the course Generic Styles Generic Style Specializations Generic Component Integration Standards Domain-Spec Component Integration Standards Product Line Frameworks Data Flow Call-Return... Pipes & Filters Process Control... domain-specificity CORBA COM JavaBeans... EJB HLA... Tektronix Oscilloscopes Lab1 Framework... Lecture 2 Data Flow Systems 52 26