Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.

Slides:



Advertisements
Similar presentations
Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
Advertisements

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.
CPS 506 Comparative Programming Languages Abstract Data Type and Encapsulation.
CS-2135 Object Oriented Programming
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
Abstract data types & object-oriented paradigm. Abstraction Abstraction: a view of an entity that includes only the attributes of significance in a particular.
Lecture 9 Concepts of Programming Languages
Chapter 13: Object-Oriented Programming
Abstract Data Types and Encapsulation Concepts
Classes Mark Hennessy Dept. Computer Science NUI Maynooth C++ Workshop 18 th – 22 nd Spetember 2006.
An Object-Oriented Approach to Programming Logic and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
Copyright 2004 Scott/Jones Publishing Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 7 Structured Data and Classes.
CSSE501 Object-Oriented Development. Chapter 4: Classes and Methods  Chapters 4 and 5 present two sides of OOP: Chapter 4 discusses the static, compile.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Chapter 10 Classes and Objects In-Depth. Chapter 10 A class provides the foundation for creating specific objects, each of which shares the general attributes,
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
1 Chapter Four Creating and Using Classes. 2 Objectives Learn about class concepts How to create a class from which objects can be instantiated Learn.
Chapter 10, Slide 1 ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:  process abstraction  data abstraction Both provide:  information.
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Object-Oriented Programming Chapter Chapter
CSci 162 Lecture 10 Martin van Bommel. Procedures vs Objects Procedural Programming –Centered on the procedures or actions that take place in a program.
ISBN Object-Oriented Programming Chapter Chapter
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)
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 10 Abstraction - The concept of abstraction is fundamental in programming - Nearly all programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
OO in Context Lecture 13: Dolores Zage. Confused about OO Not alone, there is much confusion about OO many programs are claimed to be OO but are not really.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
ISBN Chapter 12 Support for Object-Oriented Programming.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
CompSci 280 S Introduction to Software Development
Classes (Part 1) Lecture 3
Abstract Data Types and Encapsulation Concepts
ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:
Object-Oriented Programming & Design Lecture 14 Martin van Bommel
11.1 The Concept of Abstraction
About the Presentations
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
 DATAABSTRACTION  INSTANCES& SCHEMAS  DATA MODELS.
Lecture 9 Concepts of Programming Languages
Abstract Data Types and Encapsulation Concepts
Classes and Data Abstraction
Abstract Data Types and Encapsulation Concepts
Subprograms and Programmer Defined Data Type
IFS410: Advanced Analysis and Design
Abstract Data Types and Encapsulation Concepts
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Abstract Data Types and Encapsulation Concepts
NAME 436.
Lecture 10 Concepts of Programming Languages
Creating and Using Classes
11.1 The Concept of Abstraction
Lecture 9 Concepts of Programming Languages
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

Chapter 11: Abstract Data Types Lecture # 17

Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract Data Types Language Examples Chapter 11: Abstract Data Types 2

The Concept of Abstraction An abstraction is a view or representation of an entity that includes only the most significant attributes. Chapter 11: Abstract Data Types 3

Abstraction in the World of Programming Languages In the world of programming languages, abstraction is a weapon against the complexity of programming. Its purpose is to simplify the programming process. It is an effective weapon because it allows programmers to focus on essential attributes, which ignoring subordinate attribute. Chapter 11: Abstract Data Types 4

Abstraction Used in Contemporary Programming Languages The two fundamental kinds of abstraction in contemporary programming languages are:  Process Abstraction. and  Data Abstraction. Chapter 11: Abstract Data Types 5

Process Abstraction The concept of process abstraction is among the oldest in programming language design. All subprograms are process abstractions o because they provide a way of program to specify that some process is to be done, o without providing the details of how it is to be done (at least in the calling program). Chapter 11: Abstract Data Types 6

Implementation Hiding Through access controls, unnecessary details of the type can be hidden from units outside the enclosure that use the type. An instance of an abstract data type is called an object. Chapter 11: Abstract Data Types 7

Advantages of Abstract Data Types (1) Abstract data types allow program portability between implementations of a particular language,  even though the implementations may use different representations for particular data types. Chapter 11: Abstract Data Types 8

The primary advantage of packaging the declaration of the type and its operations in a single syntactic unit is:  It provides a method of organizing a program into logical units that can be complied separately. Chapter 11: Abstract Data Types 9 Advantages of Abstract Data Types (2)

The advantage of having the implementation of the type and its operations in a different syntactic unit is that:  It is good to keep specifications and their implementations separate. Clients of an abstract data type need to see the specification, but cannot be allowed to see the implementation. Chapter 11: Abstract Data Types 10 Advantages of Abstract Data Types (3)

An important benefit of information hiding is increased reliability. Clients cannot manipulate the underlying representations of objects directly, either intentionally or by accident, thus increasing the integrity of such objects. Objects can be changed only through the provided operations. Chapter 11: Abstract Data Types 11 Advantages of Abstract Data Types (4)

Design Issues for Abstract Data Types (1) A facility for defining abstract data types in a language must provide a syntactic unit that can encapsulate:  the type definition and  subprogram definitions of the abstraction operations. It must be possible to make the type name and subprogram headers visible to clients of the abstraction. This allows clients to declare variables of the abstract type and manipulate their values. Chapter 11: Abstract Data Types 12

Although the type name must have external visibility, the type definition must be hidden. The same is often true for subprogram definitions — the headers must be visible but the bodies may be hidden. Chapter 11: Abstract Data Types 13 Design Issues for Abstract Data Types (2)

Language Examples: Abstract Data Types in C++ C++ was created by adding features to C. The first important additions were those to support object- oriented programming (OOP). Because one of the primary components of object-oriented programming is abstract data types, C++ obviously must support them. Chapter 11: Abstract Data Types 14

Class Members and Instance Members Data members and member functions appear in two categories:  Class and  instance. Class members are associated with the class. Instance members are associated with the instances of the class.  This chapter only discusses the instance members of a class. Chapter 11: Abstract Data Types 15

Properties of Class Instances All of the instances of a class share a single set of member functions. But each instance gets its own set of the class's data members. Chapter 11: Abstract Data Types 16

Definitions of Member Functions A member function of a class can be defined in two distinct ways:  The complete definition can appear in the class or  only its header. If only the header of a member function appears in the class definition, its complete definition appears outside the class and is separately compiled. Chapter 11: Abstract Data Types 17

Categories of Visibility A C++ class can contain both hidden and visible entities (meaning they are either hidden from or visible to clients of the class). Entities that are to be hidden are placed in a private clause. Entities that are to be visible are placed in a public clause. o The public clause therefore describes the interface to class objects. There is also a third category of visibility, protected, which is discussed in the context of inheritance. Chapter 11: Abstract Data Types 18

Constructor C++ allows the user to include constructor functions in class definitions, which are used to initialize the data members of newly created objects. Constructors are implicitly called when an object of the class type is created. A constructor has the same name as the class. Chapter 11: Abstract Data Types 19

Destructor A C++ class can also include a function called a destructor, which is implicitly called when the lifetime of an instance of the class ends. The name of a destructor is the class's name, preceded by a tilde (~). Chapter 11: Abstract Data Types 20