CSE 435: Software Engineering. System Design

Similar documents
System Design. Design: HOW to implement a system

System Design. Acknowledge: Atlee and Pfleeger (Software Engineering: Theory and Practice)

Design: HOW to implement a system

System Design. Design Issues. System Design. System Design. Design: HOW to implement a system. Strategic vs. Local Design Decisions.

System Design. Design: HOW to implement a system

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE

Architectural Styles I

An Introduction to Software Architecture. David Garlan & Mary Shaw 94

Software Architecture

Software Architecture

Software Architecture

Engr. M. Fahad Khan Lecturer Software Engineering Department University Of Engineering & Technology Taxila

CAS 703 Software Design

ASSIGNMENT- I Topic: Functional Modeling, System Design, Object Design. Submitted by, Roll Numbers:-49-70

An Introduction to Software Architecture

Architectural Design. Architectural Design. Software Architecture. Architectural Models

CS 307: Software Engineering. Lecture 10: Software Design and Architecture

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

Establishing the overall structure of a software system

Architectural Styles I

Design Concepts and Principles

An Introduction to Software Architecture

Software Architecture. Lecture 4

Organization of User Interface Software

Software Architecture--Continued. Another Software Architecture Example

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

XVIII. Software Architectures

Architectural Design

CHAPTER 5 GENERAL OOP CONCEPTS

5/9/2014. Recall the design process. Lecture 1. Establishing the overall structureof a software system. Topics covered

Chapter 6 Architectural Design. Lecture 1. Chapter 6 Architectural design

Chapter 6 Architectural Design

XIX. Software Architectures

UNIT II Requirements Analysis and Specification & Software Design

Architectural Styles II

Architectural Design

XVIII. Software Architectures

Review Sources of Architecture. Why Domain-Specific?

Design Process Overview. At Each Level of Abstraction. Design Phases. Design Phases James M. Bieman

Creational. Structural

6/20/2018 CS5386 SOFTWARE DESIGN & ARCHITECTURE LECTURE 5: ARCHITECTURAL VIEWS C&C STYLES. Outline for Today. Architecture views C&C Views

Introduction. CS3026 Operating Systems Lecture 01

Architectural Design

Architectural Styles. Reid Holmes

Software Architecture. Lecture 5

Software Design Fundamentals. CSCE Lecture 11-09/27/2016

ICS 52: Introduction to Software Engineering

Architecture Styles. Instructor: Yongjie Zheng February 7, CS 5553: Software Architecture and Design

ICS 52: Introduction to Software Engineering

Introduction to System Design

Software Architecture in Practice

Chapter 13: Architecture Patterns

Chapter 6 Architectural Design. Chapter 6 Architectural design

Architectural Styles. Software Architecture Lecture 5. Copyright Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.

Transactions. Lecture 8. Transactions. ACID Properties. Transaction Concept. Example of Fund Transfer. Example of Fund Transfer (Cont.

Roadmap of This Lecture

Software Architectures. Lecture 6 (part 1)

Lecture 1. Chapter 6 Architectural design

Architectural Design. CSCE Lecture 12-09/27/2016

Distributed KIDS Labs 1

Chapter 14: Transactions

What is Software Architecture

Software Architecture

Chapter 15: Transactions

CS 307: Software Engineering. Lecture 9: Software Design (Coupling), Modeling Interactions and Behavior

References. Transaction Management. Database Administration and Tuning 2012/2013. Chpt 14 Silberchatz Chpt 16 Raghu

Software Architecture

Architecture CSE 403. Fallingwater by Frank Lloyd Wright

Transactions. Silberschatz, Korth and Sudarshan

Outline. Failure Types

Refresher: Lifecycle models. Lecture 22: Moving into Design. Analysis vs. Design. Refresher: different worlds. Analysis vs. Design.

Transactions. Prepared By: Neeraj Mangla

Systems-Level Architecture. A Re-Introduction Arch. Reintro CSC Level of Design. Divide into two levels:

Process and data flow modeling

Chapter 9: Transactions

AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Chapter 15: Transactions

What do Compilers Produce?

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology

The Analysis and Design of the Object-oriented System Li Xin 1, a

From Module To Objects

Introduction to Software Engineering 10. Software Architecture

Threads SPL/2010 SPL/20 1

UNIT III. Software Design

BİL 354 Veritabanı Sistemleri. Transaction (Hareket)

A REVIEW OF BASIC KNOWLEDGE OF DATABASE SYSTEM

Transaction Concept. Two main issues to deal with:

WHAT IS SOFTWARE ARCHITECTURE?

Contemporary Design. Traditional Hardware Design. Traditional Hardware Design. HDL Based Hardware Design User Inputs. Requirements.

In this Lecture you will Learn: System Design. System Architecture. System Architecture

Architectural Design. Topics covered. Architectural Design. Software architecture. Recall the design process

Software Paradigms (Lesson 10) Selected Topics in Software Architecture

Describing the architecture: Creating and Using Architectural Description Languages (ADLs): What are the attributes and R-forms?

Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 6, System Design Lecture 1

In his paper of 1972, Parnas proposed the following problem [42]:

Software Architecture and Design I

ICOM 5016 Database Systems. Chapter 15: Transactions. Transaction Concept. Chapter 15: Transactions. Transactions

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

Transcription:

System Design

Design: HOW to implement a system Goals: Satisfy the requirements Satisfy the customer Reduce development costs Provide reliability Support maintainability Plan for future modifications

Design Issues Architecture User Interface Data Types Operations Data Representations Algorithms

System Design Choose high-level strategy for solving problem and building solution Decide how to organize the system into subsystems Identify concurrency / tasks Allocate subsystems to HW and SW components

Strategic vs. Local Design Decisions Defn: A high-level or strategic design decision is one that influences the form of (a large part) of the final code Strategic decisions have the most impact on the final system So they should be made carefully Question: Can you think of an example of a strategic decision?

System Design Defn: The high-level strategy for solving an [information flow] problem and building a solution Includes decisions about organization of functionality. Allocation of functions to hardware, software and people. Other major conceptual or policy decisions that are prior to technical design. Assumes and builds upon thorough requirements and analysis.

Taxonomy of System-Design Decisions Devise a system architecture Choose a data management approach Choose an implementation of external control

System Architecture A collection of subsystems and interactions among subsystems. Should comprise a small number (<20) of subsystems A subsystem is a package of classes, associations, operations, events and constraints that are interrelated and that have a reasonably well-defined interface with other subsystems, Example subsystems: Database management systems (RDBMS) Interface (GUI) package

Architectural Design Principles Decompose into subsystems ayers and partitio s. Separate application logic from user interface Simplify the interfaces through which parts of the system will connect to other systems. In systems that use large databases: Distinguish between operatio a (tra sactio a ) and i quiry systems. Exploit features of DBMS

Layered Subsystems Set of virtual worlds Each layer is defined in terms of the layer(s) below it Knowledge is one-way: Layer knows about layer(s) below it Objects within layer can be independent Lower layer (server) supplies services for objects (clients) in upper layer(s)

Example: Layered architecture Interactive Graphics Application Windows Operations Screen Operations Pixel Operations Device I/O Operations

Closed Architectures Each layer is built only in terms of the immediate lower layer Reduces dependencies between layers Facilitates change

Open Architectures Layer can use any lower layer Reduces the need to redefine operations at each level More efficient /compact code System is less robust/harder to change

Properties of Layered Architectures Top and bottom layers specified by the problem statement Top layer is the desired system Bottom layer is defined by available resources (e.g. HW, OS, libraries) Easier to port to other HW/SW platforms

Partitioned Architectures Divide system into weakly-coupled subsystems Each provides specific services Vertical decomposition of problem

Ex: Partitioned Architecture Operating System Virtual File Process Memory Device System Control Manage- Control ment

Typical Application Architecture Application package User dialogue control Window graphics Screen graphics Pixel graphics Operating system Computer hardware Simulation package

System Topology (also known as SW Architecture) Describe information flow Can use DFD to model flow Some common topologies Pipeline (batch) Star topology Peer-to-peer

Pipes-and-Filter The system has Streams of data (pipe) for input and output Transformation of the data (filter) KEY pipe

Ex: Pipeline Topology (Architecture) Compiler: source program Lexical analyzer token stream Semantic analyzer abstract syntax tree Code generator code sequence Code optimizer object code

Ex: Pipeline Topology (Architecture) Compiler: BNF grammar source program Lexical analyzer token stream Semantic analyzer abstract syntax tree Code generator code sequence Code optimizer object code

Pipes and Filter Several important properties The designer can understand the entire system's effect on input and output as the composition of the filters The filters can be reused easily on other systems System evolution is simple Allow concurrent execution of filters Drawbacks Encourages batch processing Not good for handling interactive application Duplication in filters functions Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Ex: Star Topology (Architecture) Monitoring system: Sensors Control panel sensor status commands, data display information SafeHome software Alarm number tones On/Off signals, alarm type Telephone line

Peer-to-Peer (P2P) Each component acts as its own process and acts as both a client and a server to other peer components. Any component can initiate a request to any other peer component. Characteristics Scales up well Increased system capabilities Highly tolerant of failures Examples: Napster and Skype Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Two types of components: Client-Server Server components offer services Clients access them using a request/reply protocol Client may send the server an executable function, called a callback The server subsequently calls under specific circumstances Atlee and Pfleeger

Publish-Subscribe Components interact by broadcasting and reacting to events Component expresses interest in an event by subscribing to it When another component announces (publishes) that event has taken place, subscribing components are notified Implicit invocation is a common form of publish-subscribe architecture o Registering: subscribing component associates one of its procedures with each event of interest (called the procedure) Characteristics Strong support for evolution and customization Easy to reuse components in other event-driven systems Need shared repository for components to share persistent data Difficult to test Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Repositories Two components A central data store A collection of components that operate on it to store, retrieve, and update information The challenge is deciding how the components will interact A traditional database: transactions trigger process execution A blackboard: the central store controls the triggering process Knowledge sources: information about the current state of the system s execution that triggers the execution of individual data accessors Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Repositories (continued) Major advantage: openness Data representation is made available to various programmers (vendors) so they can build tools to access the repository But also a disadvantage: the data format must be acceptable to all components Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Combining Architectural Styles Actual software architectures rarely based on purely one style Architectural styles can be combined in several ways Use different styles at different layers (e.g., overall client-server architecture with server component decomposed into layers) Use mixture of styles to model different components or types of interaction (e.g., client components interact with one another using publish-subscribe communications If architecture is expressed as collection of models, documentation must be created to show relation between models Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

Combination of Publish-Subscribe, Client- Server, and Repository Architecture Styles Pfleeger and Atlee, Software Engineering: Theory and Practice, edited by B. Cheng, 2010

PAUSE

Taxonomy of System-Design Decisions Devise a system architecture Choose a data management approach Choose an implementation of external control

Choosing a Data Management Approach Databases: Advantages: o Efficient management o Multi-user support. o Roll-back support Disadvantages: o Performance overhead o Awkward (or more complex) programming interface o Hard to fix corruption

Choosing a Data Management Approach (continued) Flat files Advantages: o Easy and efficient to construct and use o More readily repairable Disadvantages: o No rollback o No direct complex structure support o Complex structure requires a grammar for file format

Flat File Storage and Retrieval Useful to define two components (or classes) Reader reads file and instantiates internal object structure Writer traverses internal data structure and writes out presentation Both can (should) use formal grammar Tools support: Yacc, Lex.

Taxonomy of System-Design Decisions Devise a system architecture Choose a data management approach Choose an implementation of external control

Implementation of External Procedure-driven: Control Four general styles for implementing software control Control = location in the source code. Requests block until request returns Example: standard computational and/or scientific applications Event-Driven: Control resides in dispatcher Uses callback functions registered for events Dispatcher services events by invoking callbacks Example: graphical user interfaces; windowing systems

Implementation of External Control Concurrent Control resides in multiple, concurrent objects Objects communicate by passing messages o across busses, networks, or memory. Example: onboard electronics in vehicles Transactional Control resides in servers and saved state Example: Many server-side E-systems are like this

Sample Concurrent System Control target acquisition target loss distance Radar x1: integer x2: integer tinc: integer vc: integer vt:integer v:integer tmin: integer = 2 z1: integer z2: integer xhit: integer xcoast: integer setspd: integer a: integer = 15 closing: boolean carspeed throttle control Car carspeed setv: integer realv: integer v: integer vc: integer vt: integer x: integer tmode: booelan

Dispatcher Model (event driven) Process event type 1 Events Get event, call a procedure Process event type 2 Process event type N Window manager & Notifier Application code

Event-driven architecture in UI toolkits Window manager User-interface component Application code Get events and dispatch Events Widget1 (e.g. Button) Widget2 (e.g. TextBox) Button Listener Text Listener Widget3 (e.g. Dialog) Listener

Typical Dispatcher Code Event Loop Startup while (!quit) { WaitEvent(timeout, id); switch (id) { case ID1: Procedure1(); break; case ID2: Procedure2(); break;. } }

Transactional Model System/network Server Mimics event-driven Application/initial Application/Classes State manager Restore state Dispatch based on previous state Object A Object B Object C

Transactional Model ACID Model: Atomicity: all or nothing with respect to permanent effect of actions Consistency: o at start of actions, system is in consistent state; o upon completion (i.e. commit ), system is consistent? Isolation: All transactions work as if in isolation Durability: Entities stored in persistent media (e.g., database, file) 2-step Commit Protocol: First step initiates the actions (if abort executed, rollback to previous consistent state) Second step: commit the effect of the actions. Examples: Relational databases Graphical/word processing editors (think about undo operation) Reference: http://www.agiledata.org/essays/transactioncontrol.html

General Design Concerns Modularity Abstraction Cohesion Coupling Information Hiding Abstract Data Types Identifying Concurrency Global Resources Boundary Conditions Tradeoffs

Modularity Organize modules according to resources/objects/data types Provide cleanly defined interfaces operations, methods, procedures,... Hide implementation details Simplify program understanding Simplify program maintenance

Abstraction Control abstraction structured control statements exception handling concurrency constructs Procedural abstraction procedures and functions Data abstraction user defined types

Abstraction (cont.) Abstract data types encapsulation of data Abstract objects subtyping generalization/inheritance

Cohesion Contents of a module should be cohesive Somehow related Improves maintainability Easier to understand Reduces complexity of design Supports reuse

(Weak) Types of cohesiveness Coincidentally cohesive contiguous lines of code not exceeding a maximum size Logically cohesive all output routines Temporally cohesive all initialization routines

(Better) Types of cohesiveness Procedurally cohesive routines called in sequence Communicationally cohesive work on same chunk of data Functionally cohesive work on same data abstraction at a consistent level of abstraction

Example: Poor Cohesion package Output is procedure DisplayDice(...); procedure DisplayBoard(...); Dice I/O device Output Board

Example: Good Cohesion package Dice is procedure Display (...); procedure Roll(...); Dice I/O device Board

Coupling Co ectio s between modules Bad coupling Global variables Flag parameters Direct manipulation of data structures by multiple classes

Coupling (cont.) Good coupling Procedure calls Short argument lists Objects as parameters Good coupling improves maintainability Easier to localize errors, modify implementations of an objects,...

Information Hiding Hide decisions likely to change Data representations, algorithmic details, system dependencies Black box Input is known Output is predictable Mechanism is unknown Improves maintainability

Information Hiding

Abstract data types Modules (Classes, packages) Encapsulate data structures and their operations Good cohesion o implement a single abstraction Good coupling o pass abstract objects as parameters Black boxes o hide data representations and algorithms

Identifying Concurrency Inherent concurrency May involve synchronization Multiple objects receive events at the same time without interacting Example: o User may issue commands through control panel at same time that the sensor is sending status information to the SafeHome system

Determining Concurrent Tasks Thread of control Path through state diagram with only one active object at any time Threads of control are implemented as tasks Interdependent objects Examine state diagram to identify objects that can be implemented in a task

Global Resources Identify global resources and determine access patterns Examples physical units (processors, tape drives) available space (disk, screen, buttons) logical names (object IDs, filenames) access to shared data (database, file)

Boundary Conditions Initialization Constants, parameters, global variables, tasks, guardians, class hierarchy Termination Release external resources, notify other tasks Failure Clean up and log failure info

Identify Trade-off Priorities Establish priorities for choosing between incompatible goals Implement minimal functionality initially and embellish as appropriate Isolate decision points for later evaluation Trade efficiency for simplicity, reliability,...