CSE 403: Notkin #2 of 3 on software change

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

The Modular Structure of Complex Systems Team 3 Nupur Choudhary Aparna Nanjappa Mark Zeits.
The design process IACT 403 IACT 931 CSCI 324 Human Computer Interface Lecturer:Gene Awyzio Room:3.117 Phone:
Families of Software Systems Notkin: 3 of 3 lectures on change.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part I)
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
1 SYSTEM and MODULE DESIGN Elements and Definitions.
Chapter 1 Software Engineering. Homework ► Read Section 2.2 (pages 79-98) ► Answer questions: ► 7, 8, 11, 12, & 13 on page 134. ► Answer on paper, hand.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Abstract Data Types and Encapsulation Concepts
03 - ParnasCSC4071 A Sketchy Evolution of Software Design 1960s –Structured Programming (“Goto Considered Harmful”, E.W.Dijkstra) Emerged from considerations.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
CSE 303 – Software Design and Architecture
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
SOFTWARE DESIGN.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Key Principles of Software Architecture and Design (I) adapted from Dave Penny’s.
9/20/6Lecture 3 - Instruction Set - Al1 Program Design.
CSE403 Software Engineering Autumn 2001 Design (Information Hiding) Gary Kimura Lecture #8 October 17, 2001.
Design Concepts By Deepika Chaudhary.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Abstraction ADTs, Information Hiding and Encapsulation.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
“Architecture” The outcome of top-level design, reflecting principal design decisions Can (and should) be modified and updated Analogous to architecture.
Design CS 470 – Software Engineering I Sheldon X. Liang, PH.D.
Advanced Data Structures Lecture 1
Principles of programming languages 10: Object oriented languages
7. Modular and structured design
Algorithms and Problem Solving
Engineering Problem Solving With C An Object Based Approach
SOFTWARE DESIGN AND ARCHITECTURE
Chapter 11 Object-Oriented Design
Data Abstraction: The Walls
Lecture 9- Design Concepts and Principles
Tutorial on BoxScript: A Component-Oriented Language
Chapter 3: Using Methods, Classes, and Objects
Part 3 Design What does design mean in different fields?
11.1 The Concept of Abstraction
Introduction to Algorithms
Prepared by Charlie Meyer, May 2009
Introduction CSE 1310 – Introduction to Computers and Programming
Designing Software for Ease of Extension and Contraction
HCI in the software process
The design process Software engineering and the design process for interactive systems Standards and guidelines as design rules Usability engineering.
The design process Software engineering and the design process for interactive systems Standards and guidelines as design rules Usability engineering.
Creating and Using Classes
Design by Contract Fall 2016 Version.
Subroutines Idea: useful code can be saved and re-used, with different data values Example: Our function to find the largest element of an array might.
Problem Solving Techniques
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
Functions, Procedures, and Abstraction
Objective of This Course
CSE 403, Winter 2003 Software Engineering
Lecture 9- Design Concepts and Principles
Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach
On the Criteria To Be Used in Decomposing Systems into Modules
On the Criteria To Be Used in Decomposing Systems into Modules D. L
CSE403 Software Engineering Autumn 2000 Design (Overview)
HCI in the software process
CS310 Software Engineering Lecturer Dr.Doaa Sami
Algorithms and Problem Solving
Introduction to Data Structure
Introduction to Object-Oriented Programming
CSE403 Software Engineering Autumn 2000 Design (Information Hiding)
Module Structure David Parnas Discusses “modularization”
11.1 The Concept of Abstraction
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

CSE 403: Notkin #2 of 3 on software change Information Hiding

Today’s educational objective Understand information hiding as a principle for decomposing systems into modules

Background “I assume the programmer’s genius matches the difficulty of his problem and assume that he has a arrived at a suitable subdivision of the task.” —Dijkstra “Usually nothing is said about the criteria to be used in dividing the system into modules.” —Parnas

Information hiding principle A fundamental cost in software engineering is accommodating change A change that requires modifying multiple modules is more costly than a change that is isolated in a single module Therefore Anticipate likely changes Define interfaces that capture the stable aspects and implementations that capture the changeable aspects

Small examples double sqrt (int) type intSet is intSet create(); insert(intSet,int); delete(intSet,int); bool member(intSet,int); int size(intSet); end intSet; double sqrt (int) Can be implemented using bisection methods, factoring methods, Newton’s method The client doesn’t care, and this can change (requiring only relinking) Very low level example, of course Classic example of data abstraction The representation and algorithms are hidden They can change without affecting clients

Hiding secrets These two examples show specific kinds of secrets that modules hide Algorithms Data representations The interfaces capture stable decisions Clients depend on these interfaces The implementations encode the changeable parts Clients do not depend on these

Interface An interface has two parts The signature: the names and type information about the exported functions The specification: a precise description of the semantics of the elements in the module Most commonly, the signature is in a programming language and the specification is in natural language But you cannot neglect the specification

Example The contract with the client includes semantic information double sqrt (int x) { a legitimate different implementation } double sqrt (int x) { return 3.14159; } bool member (intSet s,int i) { return IsOdd(i) } The contract with the client includes semantic information

Design Level Information hiding is a design principle, not a coding principle Obviously, it can be reflected in code that is based on the design

Anticipating change It’s “easy” to anticipate algorithmic and representational changes But you cannot and should not do this and only this By blithely anticipating these changes, you may not think about another kind of change that is more likely and potentially costly In general, you cannot build a design that effectively anticipates all changes

Data isn’t always abstracted Unix byte streams are pervasive imagine trying to change Unix’s data model from byte streams to fixed width records good or bad decision? y2k problems arose because a date representation was exposed The USPS, the DJIA and McDonald’s have also faced similar problems Other examples?

Other kinds of secrets An information hiding module can hide other secrets Characteristics of a hardware device Ex: whether an on-line thermometer measures in Fahrenheit or Centigrade Where information is acquired Ex: the Metacrawler (www.metacrawler.com) might hide what other web search engines it uses Other examples?

KWIC: the classic example Output aid to come to the all good students for come to the aid to for all good students good students for all is the time now now is the time of their professors professors of their students for all good the aid to come to the time now is their professors of time now is the to come to the aid to the aid to come Input now is the time for all good students to come to the aid of their professors

The classic decomposition Top-down functional decomposition Stepwise refinement Based on the steps the actual computation will take

The data decomposition Not based on the actual computation steps Hides decisions about data representation Could they be hidden in the previous decomposition? Hides decisions about the granularity of sorting The “sequence” relationship is hazier

Fundamentally different approaches These are really different designs They are equivalent in terms of the actual user experience Indeed, Parnas argued that in principle a compiler could produce identical executables from these two different decompositions

What about performance?