Object Oriented Programming A new way of thinking.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Programming Dr. Abraham Most slides are from your textbook.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 9 Classes.
Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
Chapter 10 Introduction to Objects and Classess 1.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
CS 2511 Fall UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Chapter 7 Object-Oriented Programming.
Advanced Java and Android Day 1 Object-Oriented Programming in Java Advanced Java and Android -- Day 11.
1 Chapter 8 Objects and Classes. 2 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections,
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 C++ Structures Starting to think about objects...
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
C++ Classes & Object Oriented Programming. Object Oriented Programming  Programmer thinks about and defines the attributes and behavior of objects. 
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
CS 2511 Fall UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○
What is Object-Oriented Programming?. Objects – Variables and Logic inside "Objects", not standalone code – Objects contain related variables and functions.
Introduction to Object-oriented programming and software development Lecture 1.
DATA STRUCTURE Introduction to Systems Programming - COMP 1005, 1405 Instructor : Behnam Hajian
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Strings Representation and Manipulation. Objects Objects : Code entities uniting data and behavior – Built from primitive data types.
Starting Out With Java 5 (Control Structures to Objects) Chapter 6 By Tony Gaddis Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
CS101 Introduction to Computing Lecture Programming Languages.
CMPD 434 MULTIMEDIA AUTHORING Chapter 06 Multimedia Authoring Process IV.
1 Chapter-01 Programming Methodologies Procedural/Structured Design Objected-Oriented Design.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
EG280 Computer Science for Engineers Fundamental Concepts Chapter 1.
Indian Institute of Technology Bombay 1 OBJECTS Lecture #8 Manish Sinha.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Learners Support Publications Object Oriented Programming.
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
CS0007: Introduction to Computer Programming Classes: Documentation, Method Overloading, Scope, Packages, and “Finding the Classes”
Objects and Classes Mostafa Abdallah
Java Fundamentals Usman Ependi UBD
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
Program Organization Sequential Execution: One line done after the other Conditional Execution: If a test is true, one section is done, otherwise another.
Object-Oriented Programming (OOP) What we did was: (Procedural Programming) a logical procedure that takes input data, processes it, and produces output.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CPS120: Introduction to Computer Science Lecture 16 Data Structures, OOP & Advanced Strings.
Starting Out With Java 5 Control Structures to Objects By Tony Gaddis Copyright © 2005, 2005 Pearson Addison-Wesley. All rights reserved. Chapter 6 Slide.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
The Parts of a Computer Name:. I am a mouse. I select things on the computer.
Matthew Small Introduction to Object-Oriented Programming.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Chapter 1: Introduction to Computers and Programming.
Introduction to Java. Java  An Object-Oriented, platform-neutral, secure language.  Object Oriented – software development method – a program is thought.
What is an object?. What Makes an Object? An object has identity (it acts as a single whole). Every object has a name that identifies what it is. Ex.
Chapter 1 Object Orientation: Objects and Classes.
Seventh step for Learning C++ Programming CLASS Declaration Public & Private Constructor & Destructor This pointer Inheritance.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Introduction to OO Programming Andy Wang Object Oriented Programming in C++ COP 3330.
Objects as a programming concept
Sections Basic Concepts of Programming
Classes and OOP.
Objects as a programming concept
GENERAL OOPs CONCEPTS.
Table of Contents Class Objects.
Unit-2 Objects and Classes
Representation and Manipulation
The Object-Oriented Thought Process Chapter 1
Ch. 1 Vocabulary Alice.
Object-Oriented Programming (OOPs)
Lecture 8 Object Oriented Programming (OOP)
Object-Oriented Programming and class Design
Presentation transcript:

Object Oriented Programming A new way of thinking

Programming Methodologies Two approaches to programming design: – Procedural Fortran, assembly, C – Object-oriented C++, Java, Python

Procedural Programming Focus is on algorithm: – Program is built by combining algorithms – Data is just what algorithms work on Issues?

Procedural Programming Issues? – Organization – Modularity

Objects Objects : Code entities uniting data and behavior

Objects Objects : Code entities uniting data and behavior Object Oriented Programming (OOP): Program consists of interacting objects

Objects Objects : Code entities uniting data and behavior Object Oriented Programming (OOP): Program consists of interacting objects Object-oriented design (OOD): – Identify objects – Determine how objects need to interact

Real World Objects Objects A pen A computer keyboard A shoe A mouse

Real World Objects ObjectsNon-objects A pen The upper 37% of the pen A computer keyboard The air above the keyboard A shoe The color of the shoe A mouse The sound of a mouse click

Real World Objects ObjectsNon-objects A pen The upper 37% of the pen A computer keyboard The air above the keyboard A shoe The color of the shoe A mouse The sound of a mouse click An object holds together as a single whole An object has properties An object can do things and can have things done to it

Code Objects Model real world objects & conceptual entities 3 Key Things: – state : it has various properties (data) – behavior : things it can do things and that can be done to it – identity : each object is a distinct individual

Ex: Circle State : – Radius – X of center? – Y of center? Behaviors : – getArea()

Procedural Version Circles represented as double: Functions to operate on circles:

Procedural Version Circles represented as struct: Functions to operate on circle struct:

Classes Classes are blueprints for objects – Define the basic form

C++ Classes class keyword defines a new type Defines members – Variables – Functions

Instantiation Individual objects are instantiated from the class description:

Using Classes Class is data type Variable stores object. operator accesses members Each object has own state c1 radius: 10 c2 radius: 25 c3 radius: 125

Writing Behaviors Object's properties available in member functions c1.getArea() getArea uses c1's radius c2.getArea() getArea uses c2's radius