
CS 331 Abstraction January 28, 2009
1 Objectives
Your objectives for today are:
•to know the most fundamental concept of computer science.
•to be able to describe the components of an ADT.
•to explain the steps of object oriented design.
•know the common models that data structures implement.
•read the Java syntax for creating, initializing, copying, and updating primitives, references, arrays, and
classes.
2 Abstraction
Abstraction is the most powerful concept in computer science. Almost everything we do as programmers or
as researchers involves abstraction.
Abstraction is another term for “model”. How do you make a model?
•First, you need a phenomenon to model.
•Second, you ask some questions about the phenomenon.
–Question 1: What are the elements of the phenomenon?
–Question 2: What are the properties of the elements?
–Question 3: Which of these elements and actions do we care about?
–This is the interface or view.
•Third, you simulate the phenomenon.
–Create an implementation for your model.
–Use the interface to restrict access to the model.
•Important question: what are the limitations of the model?
Example: Integers
•Phenomenon: the integers.
•Questions:
–Elements: zero, and positive and negative whole numbers.
–Properties: infinite set, can add, increment, subtract, etc.
–Don’t care: maybe it’s not that important to count to ∞.
•Simulation: use 16 binary digits. First one is a sign bit.
–Use built-in assembly operations to manipulate the bits.
•Limitations: can’t count past 32767.
Mattox Beckman Page 1 Illinois Institute of Technology