Abstraction in Object-Oriented Programming

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Lilian Blot Announcements Teaching Evaluation Form week 9 practical session Formative Assessment week 10 during usual practical sessions group 1 Friday.
When is Orientated Programming NOT? Mike Fitzpatrick.
Data Structures.
Modules Program is built out of components. Each component defines a set of logically related entities (strong internal coupling) A component has a public.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
1 Basic Object Oriented Concepts Overview l What is Object-Orientation about? l What is an Object? l What is a Class? l Constructing Objects from Classes.
HST 952 Computing for Biomedical Scientists Lecture 2.
1 Basic Object-Oriented Concepts  Object-Oriented Paradigm What is an Object?  What is a Class?  Constructing Objects from a class Problem Solving in.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
Optimization Problems Minimum Spanning Tree Behavioral Abstraction.
 Computer Science 1MD3 Introduction to Programming Michael Liut Ming Quan Fu Brandon.
CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.
Object Oriented Software Development
Introduction to Object-oriented programming and software development Lecture 1.
BCS 2143 Introduction to Object Oriented and Software Development.
An Object-Oriented Approach to Programming Logic and Design
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Computer Science Department Data Structures and Algorithms Lecture 1.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Introduction to Classes and Objects Initializing Objects Making Use of Classes in Algorithms Class Examples.
Review Records Dynamic Memory and Pointers Introduction to Linked Lists.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Abstraction ADTs, Information Hiding and Encapsulation.
Introduction to Classes and Objects. Real Life When a design engineer needs an electrical motor he doesn’t need to worry about –How a foundry will cast.
Object Oriented Programing (OOP)
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
2 Obaid Ullah HOD Computer Science Dept. Superior University Sialkot Campus.
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
Stacks Queues Introduction to Trees. Stacks An Everyday Example Your boss keeps bringing you important items to deal with and keeps saying: “Put that.
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Chapter 2 Principles of Programming and Software Engineering.
OBJECT ORIENTED PROGRAMMING B.TECH II YR II SEMESTER(TERM 08-09) UNIT 1 PPT SLIDES TEXT BOOKS: 1. Java: the complete reference, 7th editon, Herbert schildt,
Programming Paradigms(Model) Two Paradigms: – Procedural Programming Paradigm – Object Oriented Paradigm Objective of OO approach is to eliminate some.
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.
Principles of Programming & Software Engineering
CSC 222: Object-Oriented Programming
Object-Oriented Design
Programming paradigms
Sachin Malhotra Saurabh Choudhary
Programming Logic and Design Seventh Edition
CHAPTER 5 GENERAL OOP CONCEPTS.
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
GENERAL OOPs CONCEPTS.
Object Oriented Concepts -I
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object-Oriented Programming Using C++
Subprograms and Programmer Defined Data Type
Classes & Objects – Revisited…
Introduction Object-Oriented Programming
CPS120: Introduction to Computer Science
Introduction Object-Oriented Programming Reprise
COP 3330 Object-oriented Programming in C++
Introduction to Data Structure
Extended Learning Module G
Workshop for Programming And Systems Management Teachers
OBJECT ORIENTED PROGRAMMING
OBJECT ORIENTED PROGRAMMING
Abstraction and Objects
The OOTP is intended to get you thinking about how OO concepts are used in designing object-oriented systems. Note: not talking about OO technologies that.
Chapter 20 Object-Oriented Concepts and Principles
Presentation transcript:

Abstraction in Object-Oriented Programming

Procedural Abstraction Procedural Abstractions organize instructions. Function Power Give me two numbers (base & exponent) I’ll return to you baseexponent ??? Implementation ???

Data Abstraction Data Abstractions organize data. StudentType Name (string) GPA (num) Letter Grade (char) Student Number (num)

Behavioral Abstraction Behavioral Abstractions combine procedural and data abstractions. Data State Enqueue Is Full Is Empty Dequeue Initialize Queue Object

The Object-Oriented Paradigm Instances of behavioral abstractions are known as objects. Objects have a clear interface by which they send and receive messages (communicate). OO is a design and approach issue. Just because a language offers object-oriented features doesn’t mean you’re doing OO programming.

Information Hiding Information Hiding means that the user has enough information to use the interface, and no more Example: Stick shift We don’t care about the inner workings... We just want to get the car going! 1 2 3 4 5 R

Encapsulation Encapsulation is the grouping of related things together within some structure Item 1 Item 2 Item3

Encapsulation via Algorithms Algorithms encapsulate modules, data, and instructions. Algorithm Procedure Instructions Function Data

Encapsulating Instructions Modules encapsulate instructions. Procedure/Function Instructions Instructions Module call Instructions

Encapsulating Data Records allow us to do this with data Record Field 1 Field 2 Record

Revisiting the Question “Where is the Queue?” Notice we still have no way of identifying the idea we’re discussing… The Queue is still in the “ether.” We’d like to encapsulate the data (regardless of it’s actual representation) with the behavior (modules). Once we do this, we’ve got a logical entity to which we can point and say, “there it is!”

Encapsulating Data with Methods Abstract data types (ADTs) allow us to encapsulate logically related data and modules Queue Enqueue Data Dequeue

Abstract Data Types An idea, a concept, an abstraction of the “big picture” It encapsulates the abstract behaviors and data implied by the thing being modeled. Data State Enqueue Is Full Is Empty Dequeue Initialize Queue

Achieving Behavioral Abstraction Abstract data types (ADTs) are concepts. We require some way to implement these common abstractions so we can write them once, verify that they are correct, and reuse them. This would save us from having to re-do work. For example, every time we create a queue we did: List_Node definesa ... q_front isoftype ... q_tail isoftype ... procedure Enqueue(...) procedure Dequeue(...) We need an algorithmic construct that will allow us to bundle these things together… the class.

OO Summary Behavioral abstraction combines data abstraction with procedural abstraction. The object-oriented paradigm focuses on the interaction and manipulation of objects. An Abstract Data Type (ADT) allows us to think of what we’re representing as a thing regardless of it’s actual implementation.