UP | HOME
CS 7140

On Abstractions

Table of Contents

1 Abstraction Definition

  1. ab·strac·tion abˈstrakSHən/ noun
  2. the quality of dealing with ideas rather than events.
    1. "topics will vary in degrees of abstraction"
    2. "the question can no longer be treated as an academic abstraction"
    3. synonyms: concept, idea, notion, thought, theory, hypothesis More
  3. freedom from representational qualities in art. "geometric abstraction has been a mainstay in her work"

2 Data Abstractions

  1. sets versus linear arrays, lists, hash table
  2. bags versus …
  3. binary tree eg is not definable in Java
  4. n-ary trees versus …
  5. Abstract Data Type (ADT)
    1. Algebraic Specs
    2. Stack: push, pop, top, isempty, cons
    3. Binary-Tree: …

3 Control Abstractions

  1. multiple assignment
  2. for-all
  3. map-reduce

4 Abstraction v Encapsulation

  1. Information Hiding
  2. Abstraction is about ignoring nitty-gritty details while keeping essential details
  3. Encapsulation is about controlling access to methods that implement abstractions.

5 OOP and Abstraction

  1. Design by Contract
  2. Java and C++ pretty good at encapsulation; pretty poor on abstractions.

6 Java and Abstraction

  1. abstract key word has a "different" meaning
  2. abstract class: incomplete, cannot be instantiated
  3. abstract method: just a declaration, no body (implementation)
  4. interface: public static, final constant or abstract method declarations

Copyright © 2015 • www.wright.edu/~pmateti