Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
Abstract Data Types Data abstraction, or abstract data types, is a programming methodology where one defines not only the data structure to be used, but.
Topics Recap of the Object Model Inheritance Polymorphism – virtual functions Abstract classes, Pure virtual functions Design issues UML examples Templates.
Lecture # 02 07/02/2013Dr. Muhammad Umair 1. 07/02/2013Dr. Muhammad Umair 2  Numeric  Integer Numbers  0,10,15,4563 etc.  Fractional Number  10.5,
1 Problem Solving Abstraction Oftentimes, different real-world problems can be modeled using the same underlying idea Examples: Runtime storage, Undo operation.
Road Map Introduction to object oriented programming. Classes
CHAPTER 3 COLLECTIONS Abstract Data Types. 2 A data type consists of a set of values or elements, called its domain, and a set of operators acting on.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Chapter 2 Data Design and Implementation. Homework You should have already read section 2.2 You should have already read section 2.2 Read Section 2.3.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Lecture 9 Concepts of Programming Languages
Abstract Data Types and Encapsulation Concepts
An Object-Oriented Approach to Programming Logic and Design
1 Basic Concepts of Object-Oriented Design. 2 What is this Object ? There is no real answer to the question, but we ’ ll call it a “ thinking cap ”. l.
Object Based Programming Chapter 8. 2 In This Chapter We will learn about classes Garbage Collection Data Abstraction and encapsulation.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Data Structures and Algorithms Lecture 3 Instructor: Quratulain Date: 8 th September, 2009.
1 2 Data Design and Implementation Chapter 2 Data Design and Implementation.
Design.ppt1 Top-down designs: 1. Define the Problem IPO 2. Identify tasks, Modularize 3. Use structure chart 4. Pseudocode for Mainline 5. Construct pseudocode.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Data Abstaraction Chapter 10.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
ADT data abstraction. Abstraction  representation of concepts by their relevant features only  programming has two major categories of abstraction process.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
1 Chapter 11 © 1998 by Addison Wesley Longman, Inc The Concept of Abstraction - The concept of abstraction is fundamental in programming - Nearly.
1 CS Programming Languages Class 22 November 14, 2000.
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
Chapter 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 10 Abstraction - The concept of abstraction is fundamental in programming - Nearly all programming.
Copyright © 2009 – Curt Hill Standard Template Library An Introduction.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
72 4/11/98 CSE 143 Abstract Data Types [Sections , ]
Introduction to Objects and Encapsulation Computer Science 4 Mr. Gerb Reference: Objective: Understand Encapsulation and abstract data types.
REEM ALMOTIRI Information Technology Department Majmaah University.
CSC 243 – Java Programming, Spring, 2014 Week 4, Interfaces, Derived Classes, and Abstract Classes.
CPSC 252 ADTs and C++ Classes Page 1 Abstract data types (ADTs) An abstract data type is a user-defined data type that has: private data hidden inside.
David Evans CS201J: Engineering Software University of Virginia Computer Science Lecture 5: Implementing Data Abstractions.
1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
CSC 243 – Java Programming, Fall, 2008 Tuesday, September 30, end of week 5, Interfaces, Derived Classes, and Abstract Classes.
Prof. I. J. Chung Data Structure #1 Professor I. J. Chung.
Object Based Programming Chapter 8. 2 Contrast ____________________ Languages –Action oriented –Concentrate on writing ________________ –Data supports.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
CSIS 123A Lecture 1 Intro To Classes Glenn Stevenson CSIS 113A MSJC.
Data Design and Implementation
Business System Development
Abstract Data Types and Encapsulation Concepts
Chapter 3: Using Methods, Classes, and Objects
11.1 The Concept of Abstraction
Lecture 9 Concepts of Programming Languages
Abstract Data Types and Encapsulation Concepts
Object Based Programming
CS148 Introduction to Programming II
Classes and Data Abstraction
Abstract Data Types and Encapsulation Concepts
Subprograms and Programmer Defined Data Type
Introduction to Data Structure
2.1 Introduction to Object-Oriented Programming
Oriented Design and Abstract Data Type
11.1 The Concept of Abstraction
Lecture 9 Concepts of Programming Languages
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes, arrays Lists, stacks, etc. Data Abstraction View the data the way we want to (not the way computer does)

Data Abstraction Abstract – can be scary, but you’ve already been doing that Example: Integer you view in a higher level than a computer (which uses bits, two’s complement notation) All you need to know is what is an integer and what operations are allowed on them The int type is encapsulated (surrounded by a nice neat package to manipulate it)

Data encapsulation Means the physical representation of data is surrounded, the user doesn’t see the implementation, but deals with data only in terms of its logical picture (or abstraction) Separations of the representation of data from the applications that use the data at a logical level; a programming language feature that enforces information hiding

Abstract Data Type (ADT) A data type whose properties (domain and operations) are specified independently of any particular implementation.

Data Structures A collection of data elements whose organization is characterized by accessing operations that are used to store and retrieve the individual data elements The concrete implementation of the composite data members in an abstract data type

Features of ADTs Data structures can be decomposed into their component elements Component elements can be “arranged” in a way that affects their access Both arrangement and way accessed are encapsulated. Example: library

Views Logical (abstract) – What is ADT and what are its operations (Application) – Use them Physical (concrete) or implementation – How they are represented and how they work. ALSO THE ORDER WE’’LL STUDY THE ADTs

Information Hiding in ADTs Separating class declaration/definition in.h and.cpp files aids information hiding (as well as using private) 1. Clients – access to info needed to use class and nothing more 2. Implementer – access to info needed to implement the module and nothing more

Advantages to Information Hiding Client 1. Easier to understand 2. Protected against inadvertently using implementation detail that may change Implementer 1. Can freely modify representation of type or implementation of operation (client’s code will still work) 2. Implementation protected from erroneous use by client

Categories of ADT operations Constructors – bring into existence Transformers (mutators) – change the state Observers – predicates, accessor or selector functions, summary functions Iterators – process all the components