Object Oriented Programming A brief review of what you should know about OOP.

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

Introduction to Object Orientation System Analysis and Design
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
When is Orientated Programming NOT? Mike Fitzpatrick.
Object-Oriented Programming Python. OO Paradigm - Review Three Characteristics of OO Languages –Inheritance It isn’t necessary to build every class from.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
1 Object-Oriented Programming OOP. 2 Object-oriented programming is a new paradigm for program development in which the focus is on the data instead of.
Classes & Objects Computer Science I Last updated 9/30/10.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
BACS 287 Basics of Object-Oriented Programming 1.
Object Oriented Programming
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
OOP- OBJECT OBJECT PROGRAMMING By KRATI SHARMA 02 XI-B ✏✏✏✏ ☺☻☺☻☺☻☺ ✏✏✏✏
Programming Languages and Paradigms Object-Oriented Programming.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Object Oriented Programming Development
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
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.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 24P. 1Winter Quarter C++ Lecture 24.
CSSE501 Object-Oriented Development. Chapter 4: Classes and Methods  Chapters 4 and 5 present two sides of OOP: Chapter 4 discusses the static, compile.
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.
Abstraction ADTs, Information Hiding and Encapsulation.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Salman Marvasti Sharif University of Technology Winter 2015.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter More on Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Learning OOP in PHP. What is OOP? OOP stands for Object Oriented Programming. OOP is a programming paradigm wherein you create “objects” to work with.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CSCE 240 – Intro to Software Engineering Lecture 3.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
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.
Introduction to Object-oriented Programming
Programming paradigms
Object-Oriented Programming Concepts
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
CHAPTER 5 GENERAL OOP CONCEPTS.
Object Oriented Programming in Java
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
INTRODUCTION TO OOP Objective:
Types of Programming Languages
Object Oriented Analysis and Design
Object-Oriented Programming
COP 3330 Object-oriented Programming in C++
By Rajanikanth B OOP Concepts By Rajanikanth B
Object-Oriented PHP (1)
CPS120: Introduction to Computer Science
Lecture 10 Concepts of Programming Languages
C++ Object Oriented 1.
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Object Oriented Programming A brief review of what you should know about OOP

Programming Paradigms What is a paradigm? –A model, pattern, or typical example –A world-view used in doing something What are programming paradigms? –Virtual computer models for writing code Examples of programming paradigms –Machine code, assembly language –Structured programming; OOP

Structured programming Early paradigms focused on the hardware –This approach focused on execution sequence, program flow –Many programmers wrote “spaghetti” code In 1968, Edgar Dijkstra published a letter: –GOTO considered harmful –Structured logic more readable: If-then-else, while-loops, single-entry/exit blocks

The OO Paradigm In 1976, Niklaus Wirth (neeklouse veert) Algorithms+Data Structures = Programs Don’t focus on just algorithms (code flow) Balance data & algorithm emphasis at every level of programming Use modules that include data structure and operations

OOP objects OOP is based on objects that have data and operations (methods) The data describes the object’s –State, and –Properties The methods describe –What you can do to the object, and –What you can have it do for you

Prototype and Instance Objects Most OO models allow dealing with objects in two ways: –Prototype objects are models for lots of similar objects: car, person, pet, package –Instance objects are specific examples: my 1996 red Civic, Jay Leno, Sarah’s puppy, my Christmas gift from my son Eric In some languages, prototype objects are called classes and/or types

Object interaction Objects interact with each other using –Messages! –In some languages, messages are implemented by function calls –When you click on an object to get a context menu and then select a choice from the menu, you are “sending it a message” to perform that method (operation) –It may cause a return message (return value)

Features of OOP Programming languages that support OOP provide 3 features: –Encapsulation –Polymorphism –Inheritance

Encapsulation Encapsulation is the OOP feature that provides container modularity 2 ways - –Grouping: allowing related data and a set of operations to be grouped (remember Wirth?) –Hiding: protecting the internal workings of the “black box” and defining the external interface or how you can interact with the box

Polymorphism Polymorphism is language support for using the same name for similar operations on different kinds of objects It would be very disappointing to need to learn separate names or operators for adding ints, floats, and doubles instead of just using “+” for each of them

Polymorphism in C++ Polymorphism is provided in C++ by –Automatic type conversions –Function & operator overloading –Inheritance Member function overriding Virtual functions and pure virtual functions –Templates –+ overload resolution is involved in all of these We will use each of them in this class!

Inheritance In OOP, inheritance is a form of “factoring” An expression can be easier to calculate if you separate out a common factor If a program uses the same code several places, “factor” it out as a function to call If a bunch of objects have shared subsets of data and operations, “factor” out a base class (and only maintain it one place)

Inheritance and Sub-classes The usual reason why objects share data properties and operations is sub-classing Cars, trucks, busses, boats, and airplanes share many properties and operations because they are all vehicle sub-classes Students, faculty, and staff share object properties and operations because they are all people

C++ Features to Review Here are some OOP features of C++ –Public, private, and protected in classes –Defining classes using inheritance –Visibility rules in derived classes (inheritance) –Function overloading Operator overloading (including I/O: >) Differences for member functions You should review all of these!