The P ower Power o f of A bstraction Abstraction Barbara Liskov October 2009

Similar documents
The Power of Abstraction. Barbara Liskov November 2009

The Power of Abstraction. Barbara Liskov May 2013 MIT CSAIL

CS 292 Software Development

CSc 520. Principles of Programming Languages 29: Control Flow Iterators

CSc 520. Iterators. CLU-style Iterators... CLU-style Iterators. Principles of Programming Languages. Christian Collberg April 16, 2003

CSc 520 Principles of Programming Languages

Topics. Modularity and Object-Oriented Programming. Dijkstra s Example (1969) Stepwise Refinement. Modular program development

OOPLs Semantic Foundations. Data Abstraction Foundation of OOPLs

21) Functional and Modular Design

21) Functional and Modular Design

Modularity. Modular program development. Language support for modularity. Step-wise refinement Interface, specification, and implementation

A Sketchy Evolution of Software Design. Three Papers by David Parnas

Modules. Cardelli, 1996

Computer Programming II Python

Computer Programming II C++ (830)

Objects as Session-Typed Processes

Top Down Design vs. Modularization

Administration CS 412/413. Advanced Language Support. First-class vs. Second-class. First-class functions. Function Types

CMSC 132: Object-Oriented Programming II

Aspects of Implementing CLU

On the Criteria To Be Used in Decomposing Systems into Modules D.L. Parnas Carnegie-Mellon University

Software Engineering CSC40232: SOFTWARE ENGINEERING. Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017

Today's Agenda. References. Open Closed Principle. CS 247: Software Engineering Principles. Object-Oriented Design Principles

Lecture 9: Control Flow

Procedural Programming. It's Back? It Never Went

CSE 505 Graduate PL. Fall 2013

CMPT Data and Program Organization

Type Hierarchy. Comp-303 : Programming Techniques Lecture 9. Alexandre Denault Computer Science McGill University Winter 2004

Data Structure. Measuring Input size. Composite Data Structures. Linear data structures. Data Structure is: Abstract Data Type 1/9/2014

Lecture 7: Data Abstractions

Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava

Measuring Input size. Last lecture recap.

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

Liskov Substitution Principle

PROCESS DEVELOPMENT METHODOLOGY The development process of an API fits the most fundamental iterative code development

09. Component-Level Design

Stack effect calculus with typed wildcards, polymorphism and inheritance. Abstract

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

Inheritance and object compatibility

Software Engineering o_~r Methods for the Multi-Person Construction of Multi-Version Programs

CS2013 Course Syllabus Spring 2018 Lecture: Mon/Wed 2:00 P.M. 2:50 P.M. SH C259 Lab: Mon/Wed 2:50 P.M. 4:00 P.M. SH C259

Programming Language Concepts, CS2104 Lecture 7

AP Computer Science 4325

More Static Semantics. Static. One-Slide Summary. Lecture Outline. Typing Rules. Dispatch Rules SELF_TYPE

1: Introduction to Object (1)

Thanks! Review. Course Goals. General Themes in this Course. There are many programming languages. Teaching Assistants. John Mitchell.

AJAX: Automating an Informal Formal Method for Systematic JUnit Test Suite Generation

Reasoning About Imperative Programs. COS 441 Slides 10

CPSC 221: Algorithms and Data Structures Lecture #1: Stacks and Queues

CIS 120 Midterm II November 16, Name (printed): Pennkey (login id):

Programming language design and analysis

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

Concurrent Models of Computation for Embedded Software

Lecture 16: Object Programming Languages

Software Architecture

Lecture 20: Implementation () / 33

Lazy Modular Upgrades in Persistent Object Stores

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

References: Chapters 10 and 11 Chapters 8, and 12( 2 and 3)

CS 445: Data Structures Final Examination: Study Guide

CS 32. Lecture 2: objects good?

Outline: Software Design

CS Computable Functions. Reading: Chapter 2

Software Engineering Design Principles. Presented by Pratanu Mandal of CSE 3A Roll 54 JISCE

CSCI-1200 Data Structures Fall 2009 Lecture 25 Concurrency & Asynchronous Computing

--(1977b), 'Finite State Machine Theory and Program Design: A Survey', Computer Studies Quarterly, 1, to be published.

CIS 120 Midterm II November 16, 2012 SOLUTIONS

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus

Surfing Ada for ESP Part 2

Principles of Object-Oriented Design

The following topics will be covered in this course (not necessarily in this order).

CPSC 221: Algorithms and Data Structures ADTs, Stacks, and Queues

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

CIS 120 Midterm II November 8, 2013 SOLUTIONS

ITCS Jing Yang 2010 Fall. Class 16: Object and Object- Relational Databases (ch.11) References

Unit 1: Preliminaries Part 1: Course Introduction, Abstraction, and ADT s

Table ADT and Sorting. Algorithm topics continuing (or reviewing?) CS 24 curriculum

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

A Brief History of Modularity in Programming

Chapter 2: Java OOP I

Software Engineering

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

CS 575: Software Design

The Liskov Substitution Principle

Fall 2010 UVa David Evans. Yixin Sun

An Approach to Behavioral Subtyping Based on Static Analysis

Programming Languages 2nd edition Tucker and Noonan"

Concepts of Programming Languages

It Is Possible to Do Object-Oriented Programming in Java

Systems I: Programming Abstractions

Elementary Concepts of Object Class

Programming Languages & Paradigms PROP HT Abstraction & Modularity. Inheritance vs. delegation, method vs. message. Modularity, cont d.

Ingegneria del Software Corso di Laurea in Informatica per il Management. Software quality and Object Oriented Principles

3D Graphics Programming Mira Costa High School - Class Syllabus,

Chapter 11 Object and Object- Relational Databases

Classes and Objects. Object Orientated Analysis and Design. Benjamin Kenwright

COURSE 2 DESIGN PATTERNS

CSCI 136 Data Structures & Advanced Programming. Fall 2018 Instructors Bill Lenhart & Bill Jannen

Hoare Logic and Model Checking

Transcription:

The Power of Abstraction Barbara Liskov October 2009

Outline Inventing abstract data types CLU Type hierarchy What next

Data Abstraction Prehistory The Venus machine

The Interdata 3

Data Abstraction Prehistory The Venus machine The Venus operating system

Data Abstraction Prehistory The Venus machine The Venus operating system Programming methodology

Programming Methodology The software crisis! Machines were getting cheaper And bigger/faster E. W. Dijkstra. The Humble Programmer. Cacm, Oct. 1972

Programming Methodology How should programs be designed? How should programs be structured?

The Landscape E. W. Dijkstra. Go To Statement Considered Harmful. Cacm, Mar. 1968

The Landscape N. Wirth. Program Development by Stepwise Refinement. Cacm, April 1971

The Landscape D. L. Parnas. Information Distribution Aspects of Design Methodology. IFIP Congress, 1971 The connections between modules are the assumptions which the modules make about each other.

The Landscape D. L. Parnas, On the Criteria to be used in Decomposing Systems into Modules. Cacm, Dec. 1972

Partitions B. Liskov. A Design Methodology for Reliable Software Systems. FJCC, Dec. 1972

Partitions op1 op2 op3 Partition state

From Partitions to ADTs How can these ideas be applied to building programs?

Idea Connect partitions to data types

Meeting in Savanah ACM Sigplan-Sigops interface meeting. April 1973. (Sigplan Notices, Sept. 1973) Started to work with Steve Zilles

The Landscape Extensible Languages S. Schuman and P. Jourrand. Definition Mechanisms in Extensible Programming Languages. AFIPS. 1967 R. Balzer. Dataless Programming. FJCC 1967

The Landscape O-J. Dahl and C.A.R. Hoare. Hierarchical Program Structures. Structured Programming, Academic Press, 1972

The Landscape J. H. Morris. Protection in Programming Languages. Cacm. Jan. 1973

The Landscape W. Wulf and M. Shaw. Global Variable Considered Harmful. Sigplan Notices. Feb. 1973.

Abstract Data Types B. Liskov and S. Zilles. Programming with Abstract Data Types. ACM Sigplan Conference on Very High Level Languages. April 1974

What that paper proposed Abstract data types A set of operations And a set of objects The operations provide the only way to use The operations provide the only way to use the objects

What that paper proposed Abstract data types Clusters with encapsulation Polymorphism Static ti type checking (we hoped) Exception handling

From ADTs to CLU Participants Russ Atkinson Craig Schaffert Alan Snyder

Why a Programming Language? Communicating to programmers Do ADTs work in practice? Getting a precise definition Achieving reasonable performance

Language Design Goals Ease of use Simplicity Expressive power Performance

Language Design More goals Minimality Uniformity Safety

Some Assumptions/Decisions Heap-based with garbage collection! No block structure! Separate compilation Static type checking

More Assumptions/Decisions No concurrency No go tos No inheritance

CLU Mechanisms Clusters Polymorphism Exception handling Iterators

Clusters IntSet = cluster is create, insert, delete, isin, end IntSet t

Clusters IntSet = cluster is create, insert, delete, end IntSet IntSet s := IntSet$create( ) IntSet s := IntSet$create( ) IntSet$insert(s, 3)

Clusters IntSet = cluster is create, insert, delete, rep = array[int]

Clusters IntSet = cluster is create, insert, delete, rep = array[int] create = proc ()returns (cvt) return (rep$create( )) end create ceate

Polymorphism Set = cluster[t: type] is create, insert, end Set Set[int] s := Set[int]$create( ) Set[int]$insert(s, 3)

Polymorphism Set = cluster[t: type] is create, insert, where T has equal: proctype(t, T) returns (bool)

Polymorphism Set = cluster[t: type] is create, insert, where T has equal: proctype(t, T) returns (bool) rep = array[t] insert = proc (x: cvt, e: T) if e = x[i] then

Exception Handling J. Goodenough. Exception Handling: Issues and a Proposed Notation. Cacm, Dec. 1975 Termination vs. resumption How to specify handlers

Exception Handling choose = proc (x: T) signals (empty) if rep$size()= 0 then signal empty

Exception Handling choose = proc (x: T) signals (empty) if rep$size()= 0 then signal empty set[t]$ choose() except when empty:

Exception Handling Handling Propagating Shouldn t happen The failure exception Principles Accurate interfaces Avoid useless code

Iterators For all x in C do S

Iterators For all x in C do S Destroy the collection? Complicate the abstraction?

Visit to CMU Bill Wulf and Mary Shaw, Alphard Generators

Iterators sum: int := 0 for x: int in Set[int]$members(s) do sum := sum + x end

Iterators Set = cluster[t] is create,, members, rep = array[t] members = iter (x: cvt) yields (T) for z: T in rep$elements(x) do yield (z) end

After CLU Argus and distributed computing Type Hierarchy

The Landscape Inheritance was used for: Inplementation Type hierarchy

Implementation Inheritance Violated encapsulation!

Type hierarchy Wasn t well understood E.g., stacks vs. queues

The Liskov Substitution Principle (LSP) Objects of subtypes should behave like those of supertypes if used via supertype methods B. Liskov. Data abstraction and hierarchy. Sigplan notices, May 1988

Polymorphism where T has vs. where T subtype of S Proofs happen at different times!

What Next? Modularity based on abstraction is the way things are done

Modern Programming Languages Are good!

Missing Features Procedures are important And closures and iterators Exception handling Built-in types Can t we do better for serialization?

The state of programming Isn t great! Especially web services and browsers Especially web services and browsers Return of globals

An aside: persistent storage typically violates abstraction E.g., a file system or a database It s a big space of globals! Without support for encapsulation An object store would be much better Automatic translation Type preservation

Programming language research New abstraction mechanisms? Concurrency Multi-core machines Distributed ib t systems?

Systems research Has done well Distributed hash tables Map-reduce Client/server Distributed information flow

A Concern Performance isn t the most important issue vs. semantics vs. simplicity E.g., one-copy consistency Failures should be catastrophes

Systems Problems Internet Computer Storage and computation Semantics, reliability, availability, security Massively parallel machines

The Power of Abstraction Barbara Liskov October 2009