Ch2 - Chapter2 Data CHAPTERGOALS To be able to explain what is meant by"abstract data type and"data encapsulation To be able to describe a data

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 2 Data Design and Implementation C H A P T E R   G O A L S To be able to explain what is meant by "abstract data type" and "data encapsulation" To be able to describe a data structure from three perspectives: logical level, application level, and implementation level To be able to explain how a specification can be used to record an abstract data type To be able, at the logical level, to describe the component selector, and to describe appropriate applications for the C++ built-in types: structs, classes, one-dimensional arrays, and two-dimensional arrays To be able to declare a class object To be able to implement the member functions of a class To be able to manipulate instances of a class (objects) To be able to define the three ingredients of an object-oriented programming language: encapsulation, inheritance, and polymorphism To be able to define input/output operations for the abstract data type String from three perspectives: logical, application, and implementation 25
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2    Chapter  2   Data Design and  Implementation Chapter Outline
Background image of page 2
Chapter 2  Data Design and  Implementation    3 Teaching Notes Data Design The material in Chapter 2 underlies the concepts of data abstraction and encapsulation that are key to this text. It doesn't make sense to teach the algorithms that manipulate stacks, queues, lists, trees, and graphs without also discussing the idea of packaging and encapsulating these structures. These are basic software engineering concepts that are repeated over and over in subsequent chapters. Data Abstraction and Encapsulation We begin by comparing "data" to the nouns of the programming world. The computer's view of data—as a bunch of bits that can be turned on and off—is very different from the view that humans are comfortable with. We tend to prefer entities like "list of names" and abstractions of the underlying structure. Students might be a little put off by the word abstraction, as it might imply vagueness and lack of detail—the opposite qualities from the preciseness that they may consider appropriate for a computer program. It is important to clarify this concept; the example of the "abstract integer" may help get the point across. We do not need to know how integers are actually represented in the bits and bytes of the computer. C++ surrounds—encapsulates—the int data type with a nice neat package, and gives the programmer a set of operations to manipulate data of this type. Data Types and Structures The idea of encapsulating the actual implementation of a data structure with a set of operations is a basic concept in the text. We define every abstract data type in a specification and implement the specification in a class that binds the data and the operations together. Though the programming assignments in this course are small enough that the students are both implementers and users of ADTs, the students are taught to separate these perspectives. Built-in Structured Data Types
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/13/2011 for the course CSC 280 taught by Professor Lebre during the Spring '04 term at Moraine Valley Community College.

Page1 / 12

Ch2 - Chapter2 Data CHAPTERGOALS To be able to explain what is meant by"abstract data type and"data encapsulation To be able to describe a data

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online