Abstraction CMPS 2143. 2 Abstraction Abstraction mechanisms are techniques to deal with creating, understanding and managing complex systems Abstraction.

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

Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1 Spring 2012.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1.
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.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Basic OO Technology Technology determines the effectiveness of the approach.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-Oriented Metrics. Characteristics of OO ● Localization ● Encapsulation ● Information hiding ● Inheritence ● Object abstraction.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
1 Introduction to CS Agenda Syllabus Schedule Lecture: the management of complexity.
CS 2511 Fall Features of Object Oriented Technology  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance.
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
C++ fundamentals.
 By Wayne Cheng.  Introduction  Five Tenets  Terminology  The foundation of C++: Classes.
Introduction to Object-oriented Programming Introduction to Object-oriented Programming CMPS 2143.
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
© Drexel University Software Engineering Research Group (SERG) 1 Based on the paper by Philippe Kruchten from Rational Software.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Introduction to Object-oriented programming and software development Lecture 1.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
CSCI-383 Object-Oriented Programming & Design Lecture 4.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
Unified Modeling Language, Version 2.0
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CSCI-383 Object-Oriented Programming & Design Lecture 3.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Abstraction ADTs, Information Hiding and Encapsulation.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
CSCI 383 Object-Oriented Programming & Design Lecture 4 Martin van Bommel.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Chapter 2 Principles of Programming and Software Engineering.
Basic Characteristics of Object-Oriented Systems
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
 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
Programming paradigms
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Object Oriented Concepts -I
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Object Oriented Analysis and Design
CSC 205 – Java Programming II
CSC 205 Programming II Lecture 2 Subclassing.
Object-Oriented Design
Introduction to Computer Science for Majors II
Programming Languages and Paradigms
Object Oriented Analysis and Design
Chapter 2. Problem Solving and Software Engineering
Presentation transcript:

Abstraction CMPS 2143

2 Abstraction Abstraction mechanisms are techniques to deal with creating, understanding and managing complex systems Abstraction is the purposeful suppression or hiding of some details of a process or artifact in order to bring out more clearly other aspects, details or structures Through abstraction one builds a model of the actual system

3

Abstraction in Structured Programming void main () { ifstream infile; ofstream outfile; Container container; openFiles (infile, outfile); while moreData (infile) getData (infile, container); organizeData (container); displayData (container); closeFiles (infile, outfile); } 4

Another way to think of abstraction Factoring out redundancy ▫ Use loops ▫ Use functions (in structured programming) ▫ Use Abstract Data Types (ADTs) ▫ Use classes (in OOP) 5

6 Abstraction layers in OOP At the highest level a program is viewed as a community of cooperating objects. Each object in this community provides services At this highest level the important features are the services provided by each object and the lines of cooperation and communication between them.

7 Abstraction layers in OOP The next level of abstraction allows a group of objects working together to be grouped in a unit (packages, name spaces, units) allowing some names to be exposed to the world outside the unit while others remain hidden inside the unit library.dll

8 Abstraction layers in OOP The next two levels of abstraction deal with the interaction between 2 individual objects where one (the client) uses services from the other (the server) ▫ Server code advertises the services it can provide for the client as an interface (Java) or.h file (C++) and provides a concrete implementation for its interface ▫ Client code programs to this interface import java.util.*; Stack intStack = new Stack(); intStack.push (“data”);

9 Abstraction layers in OOP The last level of abstraction considers a single task in isolation, that is which steps implement a single method public class Stack implements IStack..{ : public void push(E e) { if top == MAX) throw new FullStackException(); items[++top] = e; } : }

10 General Forms of Abstraction abstraction division into parts “has a” multiple views Specialisation “is a” catalogs repetition service view class hierachies ADT OO programs patterns composition recursive data structures recursive algorithms dictionaries cross-references

11 Abstraction mechanisms in programming languages Procedures and Functions (function centered view) + information hiding for the detail of the behavior - no information hiding for the detail of the data - no encapsulation Modules and Packages (data centered view) + information hiding + encapsulation - instantiation not always supported Abstract Data Types + separates interface and implementation

12 Abstraction mechanisms in OO programming languages Classes are as Abstract Data Types in a service-centered view Message Passing and Method Binding bring polymorphism leading to more readable code Class Hierarchies and Inheritance bring code sharing which results in increased functionality and reduction of code size Inheritance and polymorphism together allow for tailoring shared code

Object Oriented Design Object oriented software development is NOT about the syntax of a programming language Object oriented software development is about a design technique driven by the determination and delegation of responsibilities Responsibility implies non-interference, it cuts or reduces the links between objects that depend on implementation details Goes beyond information hiding and encapsulation when dealing with programming in the large 13

References Budd Book 14