Ch. 41 Design and Software Architecture. Ch. 42 Outline What is design How can a system be decomposed into modules What is a module’s interface What are.

Slides:



Advertisements
Similar presentations
Lecture 6: Software Design (Part I)
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Component-Level Design
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Software Architecture Design Instructor: Dr. Jerry Gao.
The Architecture Design Process
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Ch4: Software Architecture and Design. 1 What is a design?
CS189A/172 - Winter 2008 Lecture 7: Software Specification, Architecture Specification.
Establishing the overall structure of a software system
Design and Software Architecture
Ch4: Software Architecture and Design. 1 Modules: Interface vs. Implementation (contd..)  Interface design considerations:
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Data Structures and Programming.  John Edgar2.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Introduction To System Analysis and design
What is design? Provides structure to any artifact Decomposes system into parts, assigns responsibilities, ensures that parts fit together to achieve a.
Chapter 7 Requirement Modeling : Flow, Behaviour, Patterns And WebApps.
Chapter 10 Architectural Design
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 13Slide 1 Architectural Design u Establishing the overall structure of a software system.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 10 Architectural Design.
Ch 031 Software Engineering Principles. Ch 032 Outline Principles form the basis of methods, techniques, methodologies and tools Seven important principles.
An Introduction to Software Architecture
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
ITEC 3220M Using and Designing Database Systems
Architectural Design portions ©Ian Sommerville 1995 Establishing the overall structure of a software system.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
 2004 by SEC Chapter 4 Software Design. 2  2004 by SEC Chapter 4 Software Design 4.1 Design Fundamentals 4.2 Design Method 4.3 Architecture Design
SOFTWARE DESIGN.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Software Architecture and Design Dr. Aldo Dagnino ABB, Inc. US Corporate Research Center October 23 rd, 2003.
Ch. 41 Design and Software Architecture. Ch. 42 Outline What is design How can a system be decomposed into modules What is a module’s interface What are.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Architectural Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
5 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
 Repository Model  Client-Server Model  Layered Model  Modular decomposition styles  Object Models  Function Oriented Pipelining  Control Styles.
Design Concepts By Deepika Chaudhary.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Chapter : 9 Architectural Design
Week 6: Software Design HNDIT Software Engineering Software Design Learning Outcomes  Understand the activities involved in the Design process.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Ch. 31 Software Engineering Principles CSC 3910 Software Engineering Time: 1:30 to 2:20Meeting Days: MWFLocation: Oxendine 1256 Textbook: Fundamentals.
Basic Characteristics of Object-Oriented Systems
Slide 1 Chapter 8 Architectural Design. Slide 2 Topics covered l System structuring l Control models l Modular decomposition l Domain-specific architectures.
Introduction to Algorithms
Algorithms and Problem Solving
Software Design.
Part 3 Design What does design mean in different fields?
What is an Architecture?
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
Software Architecture
An Introduction to Software Architecture
Algorithms and Problem Solving
Introduction to Algorithms
What is an Architecture?
Presentation transcript:

Ch. 41 Design and Software Architecture

Ch. 42 Outline What is design How can a system be decomposed into modules What is a module’s interface What are the main relationships among modules Prominent software design techniques and information hiding The UML collection of design notations Design of concurrent and distributed software Design patterns Architectural styles Component based software engineering

Ch. 43 What is design? Provides structure to any artifact Decomposes system into parts, assigns responsibilities, ensures that parts fit together to achieve a global goal Design refers to both an activity and the result of the activity

Ch. 44 Two meanings of "design“ activity in our context Activity that acts as a bridge between requirements and the implementation of the software Activity that gives a structure to the artifact –e.g., a requirements specification document must be designed must be given a structure that makes it easy to understand and evolve

Ch. 45 The sw design activity Defined as system decomposition into modules Produces a Software Design Document –describes system decomposition into modules Often a software architecture is produced prior to a software design

Ch. 46 Software architecture Shows gross structure and organization of the system to be defined Its description includes description of –main components of a system –relationships among those components –rationale for decomposition into its components –constraints that must be respected by any design of the components Guides the development of the design

Ch. 47 Two important goals Design for change –designers tend to concentrate on current needs –special effort needed to anticipate likely changes Product families –think of the current system under design as a member of a program family

Ch. 48 Sample likely changes? (1) Algorithms –e.g., replace inefficient sorting algorithm with a more efficient one Change of data representation –e.g., from binary tree to a threaded tree (see example) –  17% of maintenance costs attributed to data representation changes (Lientz and Swanson, 1980)

Ch. 49 Example

Ch. 410 Sample likely changes? (2) Change of underlying abstract machine –new release of operating system –new optimizing compiler –new version of DBMS –… Change of peripheral devices Change of "social" environment –new tax regime –EURO vs national currency in EU Change due to development process (transform prototype into product)

Ch. 411 Product families Different versions of the same system –e.g. a family of mobile phones members of the family may differ in network standards, end-user interaction languages, … –e.g. a facility reservation system for hotels: reserve rooms, restaurant, conference space, …, equipment (video beamers, overhead projectors, …) for a university –many functionalities are similar, some are different (e.g., facilities may be free of charge or not)

Ch. 412 Design goal for family Design the whole family as one system, not each individual member of the family separately

Ch. 413 Sequential completion: the wrong way Design first member of product family Modify existing software to get next member products

Ch. 414 Sequential completion: a graphical view Requirements Version 1 Version 2 5 Requirements Version 3 4 Requirements Version 2 5 Version 1 4 intermediate design final product

Ch. 415 Module A well-defined component of a software system A part of a system that provides a set of services to other modules –Services are computational elements that other modules may use

Ch. 416 Questions How to define the structure of a modular system? What are the desirable properties of that structure?

Ch. 417 Modules and relations Let S be a set of modules S = {M 1, M 2,..., M n } A binary relation r on S is a subset of S x S If M i and M j are in S,  r can be written as M i r M j

Ch. 418 Relations Relations can be represented as graphs A hierarchy is a DAG (directed acyclic graph) a graph a DAG

Ch. 419 The USES relation A uses B –A requires the correct operation of B –A can access the services exported by B through its interface –it is “statically” defined –A depends on B to provide its services example: A calls a routine exported by B A is a client of B; B is a server

Ch. 420 Desirable property USES should be a hierarchy Hierarchy makes software easier to understand –we can proceed from leaf nodes (who do not use others) upwards They make software easier to build They make software easier to test

Ch. 421 IS_COMPONENT_OF Used to describe a higher level module as constituted by a number of lower level modules A IS_COMPONENT_OF B –B consists of several modules, of which one is A B COMPRISES A M S,i ={M k |M k  S  M k IS_COMPONENT_OF M i } we say that M S,i IMPLEMENTS M i

Ch. 422 A graphical view M 1 M M M M MM M M 3 M M MM M M 2 M 3 M 4 M 1 (IS_COMPONENT_OF) (COMPRISES) They are a hierarchy

Ch. 423 Product families Careful recording of (hierarchical) USES relation and IS_COMPONENT_OF supports design of program families

Ch. 424 Interface vs. implementation (1) To understand the nature of USES, we need to know what a used module exports through its interface The client imports the resources that are exported by its servers Modules implement the exported resources Implementation is hidden to clients

Ch. 425 Interface vs. implementation (2) Clear distinction between interface and implementation is a key design principle Supports separation of concerns –clients care about resources exported from servers –servers care about implementation Interface acts as a contract between a module and its clients

Ch. 426 Interface vs. implementation (3) interface is like the tip of the iceberg

Ch. 427 Information hiding Basis for design (i.e. module decomposition) Implementation secrets are hidden to clients They can be changed freely if the change does not affect the interface Golden design principle –INFORMATION HIDING Try to encapsulate changeable design decisions as implementation secrets within module implementations

Ch. 428 Interface design Interface should not reveal what we expect may change later It should not reveal unnecessary details Interface acts as a firewall preventing access to hidden parts

Ch. 429 Prototyping Once an interface is defined, implementation can be done –first quickly but inefficiently –then progressively turned into the final version Initial version acts as a prototype that evolves into the final product

Ch. 430 Design notations Notations allow designs to be described precisely They can be textual or graphic We illustrate two sample notations –TDN (Textual Design Notation) –GDN (Graphical Design Notation) We discuss the notations provided by UML

Ch. 431 TDN & GDN Illustrate how a notation may help in documenting design Illustrate what a generic notation may look like Are representative of many proposed notations TDN inherits from modern languages, like Java, Ada, …

Ch. 432 An example

Ch. 433 Example (cont.)

Ch. 434 Benefits Notation helps describe a design precisely Design can be assessed for consistency –having defined module X, modules R and T must be defined eventually if not  incompleteness –R, T replace X  either one or both must use Y, Z

Ch. 435 Example: a compiler module COMPILER exports procedure MINI (PROG: in file of char; CODE: out file of char); MINI is called to compile the program stored in PROG and produce the object code in file CODE implementation A conventional compiler implementation. ANALYZER performs both lexical and syntactic analysis and produces an abstract tree, as well as entries in the symbol table; CODE_GENERATOR generates code starting from the abstract tree and information stored in the symbol table. MAIN acts as a job coordinator. is composed of ANALYZER, SYMBOL_TABLE, ABSTRACT_TREE_HANDLER, CODE_GENERATOR, MAIN end COMPILER

Ch. 436 Other modules module MAIN uses ANALYZER, CODE_GENERATOR exports procedure MINI (PROG: in file of char; CODE: out file of char); … end MAIN module ANALYZER uses SYMBOL_TABLE, ABSTRACT_TREE_HANDLER exports procedure ANALYZE (SOURCE: in file of char); SOURCE is analyzed; an abstract tree is produced by using the services provided by the tree handler, and recognized entities, with their attributes, are stored in the symbol table.... end ANALYZER

Ch. 437 Other modules module CODE_GENERATOR uses SYMBOL_TABLE, ABSTRACT_TREE_HANDLER exports procedure CODE (OBJECT: out file of char); The abstract tree is traversed by using the operations exported by the ABSTRACT_TREE_HANDLER and accessing the information stored in the symbol table in order to generate code in the output file. … end CODE_GENERATOR

Ch. 438 GDN description of module X

Ch. 439 X's decomposition

Ch. 440 Categories of modules Functional modules –traditional form of modularization –provide a procedural abstraction –encapsulate an algorithm e.g. sorting module, fast Fourier transform module, …

Ch. 441 Categories of modules (cont.) Libraries –a group of related procedural abstractions e.g., mathematical libraries –implemented by routines of programming languages Common pools of data –data shared by different modules e.g., configuration constants –the COMMON FORTRAN construct

Ch. 442 Categories of modules (cont.) Abstract objects –Objects manipulated via interface functions –Data structure hidden to clients Abstract data types –Many instances of abstract objects may be generated

Ch. 443 Abstract objects: an example A calculator of expressions expressed in Polish postfix form a*(b+c)  abc+* a module implements a stack where the values of operands are shifted until an operator is encountered in the expression (assume only binary operators)

Ch. 444 Specific techniques for design for change Use of configuration constants –factoring constant values into symbolic constants is a common implementation practice e.g., #define in C # define MaxSpeed 5600;

Ch. 445 Specific techniques for design for change (cont.) Conditional compilation...source fragment common to all versions... # ifdef hardware-1...source fragment for hardware 1... # endif #ifdef hardware-2...source fragment for hardware 2... # endif Software generation –e.g., compiler compilers (yacc, interface prototyping tools)

Ch. 446 Stepwise refinement A systematic, iterative program design technique that unfortunately may lead to software that is hard to evolve At each step, problem P decomposed into –sequence of subproblems: P1; P2; …Pn –a selection: if (cond) then P1 else P2 –an iteration: while (cond) do_something

Ch. 447 Example derivation of selection sort Step 1 let n be the length of the array a to be sorted; i := 1 ; while i < n loop find the smallest of ai...an, and exchange it with the element at position i; i := i + 1; end loop;

Ch. 448 Step 2 let n be the length of the array a to be sorted; i := 1 ; while i < n loop j := n; while j > i loop if a(i) > a(j) then interchange the elements at positions j and i ; end if; j := j - 1; end loop; i := i + 1; end loop;

Ch. 449 Step 3 let n be the length of the array a to be sorted; i := 1 ; while i < n loop j := n; while j > i loop if a(i) > a(j) then x := a(i); a(i) := a(j); a(j) := x; end if; j := j - 1; end loop; i := i + 1; end loop;

Ch. 450 Example Step 1 P;P problem to solve Step 2 P1; P2; P3;P decomposed into sequence Step 3 P1; while C loop P2,1;P2 decomposed into a loop end loop; P3; Step 4 P1; while C loop if C1 then P2,1 decomposed into selection P2,1,1; else P2,1,2; end if; end loop; P3;

Ch. 451 Corresponding DT

Ch. 452 Client-server architecture The most popular distributed architecture Server modules provide services to client modules Clients and servers may reside on different machines

Ch. 453 Middleware Layer residing between the network operating system and the application Helps building network applications Provides useful services –Name services, to find processes or resources on the network –Communication services, such as message passing or RPC (or RMI)

Ch. 454 Software architecture Describes overall system organization and structure in terms of its major constituents and their interactions Standard architectures can be identified –pipeline –blackboard –event based (publish-subscribe)

Ch. 455 Standard architectures pipeline event based blackboard