Learners Support Publications www.lsp4you.com 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

When is Orientated Programming NOT? Mike Fitzpatrick.
4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
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.
Classes & Objects Computer Science I Last updated 9/30/10.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
1 CIS601: Object-Oriented Programming in C++ Note: CIS 601 notes were originally developed by H. Zhu for NJIT DL Program. The notes were subsequently revised.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Object-oriented Programming Concepts
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
C++ fundamentals.
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.
Object Oriented Programming
Introduction To System Analysis and design
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
An Object-Oriented Approach to Programming Logic and Design
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
Unified Modeling Language, Version 2.0
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Stephenson College DP 96 1 Object-Orientation by Derek Peacock.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
 Programming Language  Object Oriented Programming  JAVA – An Introduction  JAVA Milestones  JAVA Features.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Definition of Object - Oriented Language.. Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions"
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
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 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Chapter -1 CONCEPT OF OBJECT ORIENTED PROGRAMMING It’s Need & Requirement :- There are many programming languages before Object Oriented Programming language.
1 Unified Modeling Language, Version 2.0 Chapter 2.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction to Object Oriented Programming (OOP) Object Oriented programming is method of programming.
Introduction to OOP CPS235: Introduction.
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.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Before Object Oriented Programming (OOP) was popular, computer software was written in a Procedural style. This meant that the application/program was.
Programming Paradigms(Model) Two Paradigms: – Procedural Programming Paradigm – Object Oriented Paradigm Objective of OO approach is to eliminate some.
Structure A Data structure is a collection of variable which can be same or different types. You can refer to a structure as a single variable, and to.
1 n Object Oriented Programming. 2 Introduction n procedure-oriented programming consists of writing a list of instructions and organizing these instructions.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
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.
Visit for more Learning Resources
Object Oriented Programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Programming Logic and Design Seventh Edition
CHAPTER 5 GENERAL OOP CONCEPTS.
Object Oriented Programming F3031
II – UNIT Procedure Oriented Programming
Object-Oriented Techniques
OOP What is problem? Solution? OOP
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Lecture 1 Introduction.
Object Oriented Analysis and Design
Principles of object – oriented programming UNIT-1 Chapter-1.
UNIT I OBJECT ORIENTED PROGRAMMING FUNDAMENTALS
Introduction to Object-Oriented Programming
Presentation transcript:

Learners Support Publications Object Oriented Programming

Learners Support Publications Objectives of this session Overview and Characteristics of Procedure- Oriented Programming Overview and Characteristics of Procedure- Oriented Programming Overview and Characteristics of Object- Oriented Programming Overview and Characteristics of Object- Oriented Programming Object-Oriented Programming – Definition Object-Oriented Programming – Definition Basic Concepts of Object-Oriented Programming Basic Concepts of Object-Oriented Programming Benefits of Object-Oriented Programming Benefits of Object-Oriented Programming

Learners Support Publications Object Oriented Programming OOP is an approach to program organization and development that attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several new concepts.

Learners Support Publications Procedure-Oriented Programming Conventional programming using high level languages like COBOL, FORTRAN, C, etc. Conventional programming using high level languages like COBOL, FORTRAN, C, etc. The problem is viewed as a sequence of things to be done. The problem is viewed as a sequence of things to be done. The primary focus is on functions. The primary focus is on functions. Procedure-oriented programming basically consists of writing a list of instructions for the computer to follow and organizing these instructions into groups known as functions. Procedure-oriented programming basically consists of writing a list of instructions for the computer to follow and organizing these instructions into groups known as functions.

Learners Support Publications Typical structure of procedure-oriented program Main Program Function-1Function-2Function-3 Function-4Function-5 Function-6Function-7Function-8

Learners Support Publications Procedure-Oriented Programming To revise an external data structure, we also need to revise all functions that access the data. To revise an external data structure, we also need to revise all functions that access the data. This approach does not model real world problems. This is because functions are action- oriented and do not really correspond to the elements of the problem. This approach does not model real world problems. This is because functions are action- oriented and do not really correspond to the elements of the problem. continue …

Learners Support Publications Relationship of data and functions in procedural programming Function-1Function-2Function-3 Local Data Global Data

Learners Support Publications Characteristics of Procedure- Oriented Programming Emphasis is on doing things. Emphasis is on doing things. Large programs are divided into smaller programs known as functions. Large programs are divided into smaller programs known as functions. Most of the functions share global data. Most of the functions share global data. Data move openly around the system from function to function. Data move openly around the system from function to function. Functions transform data from one form to another. Functions transform data from one form to another. Employs top-down approach in program design. Employs top-down approach in program design.

Learners Support Publications Object-Oriented Programming OOP treat data as a critical element in the program development and does not allow it to flow freely around the system. OOP treat data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the functions that operate on it, and protects it from accidental modification from outside functions. It ties data more closely to the functions that operate on it, and protects it from accidental modification from outside functions. OOP allows decomposition of a problem into a number of entities called objects and then build data functions around these objects. OOP allows decomposition of a problem into a number of entities called objects and then build data functions around these objects.

Learners Support Publications Object-Oriented Programming The data of an object can be accessed only by the functions associated with that object. The data of an object can be accessed only by the functions associated with that object. Functions of one object can access the functions of another objects. Functions of one object can access the functions of another objects. continue …

Learners Support Publications Organization of data and functions in OOP Data Functions Object A Data Functions Object B Data Functions Object C Communication

Learners Support Publications Characteristics of Object-Oriented Programming Emphasis is on data rather than procedure. Emphasis is on data rather than procedure. Programs are divided into objects. Programs are divided into objects. Data structures are designed such that they characterize the objects. Data structures are designed such that they characterize the objects. Functions that operate on the data of an object are tied together in the data structure. Functions that operate on the data of an object are tied together in the data structure. Data is hidden and can not be accessed by external functions. Data is hidden and can not be accessed by external functions.

Learners Support Publications Characteristics of Object-Oriented Programming Objects may communicate with each other through functions. Objects may communicate with each other through functions. New data and functions can be added easily whenever necessary. New data and functions can be added easily whenever necessary. Follows bottom-up approach in program design. Follows bottom-up approach in program design. continue …

Learners Support Publications Object-Oriented Programming Definition: Definition: It is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand. Thus the object is considered to be a partitioned area of computer memory that stores data and set of operations that can access that data.

Learners Support Publications Basic Concepts of Object-Oriented Programming Objects Objects Classes Classes Data Abstraction and Encapsulation Data Abstraction and Encapsulation Inheritance Inheritance Polymorphism Polymorphism Dynamic Binding Dynamic Binding Message Passing Message Passing

Learners Support Publications Basic Concepts of OOP Objects Objects Objects are the basic run-time entities in an object- oriented system. They may represent a person, a place, a bank account, etc. Objects take up space in the memory and have an associated address like a structure in C. When a program is executed, the objects interact by sending messages to one another. continue …

Learners Support Publications Basic Concepts of OOP Objects Objects Object : CUSTOMER DATA AC No. Name of AC Holder Address FUNCTIONS Deposit Withdrawal AC Balance Display Object : ACCOUNT DATA AC No. AC Balance Type of Account FUNCTIONS Account Balance continue …

Learners Support Publications Basic Concepts of OOP Classes Classes Classes are user-defined data types. The entire set of data and code of an object can be made a user-defined data type with the help of a class. Objects are variables of the type class. Once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is a collection of objects of similar type. continue …

Learners Support Publications Basic Concepts of OOP Classes Classes If fruit has been defined as a class, then the statement f r u i t m a n g o ; will create an object mango belonging to the class fruit. continue …

Learners Support Publications Basic Concepts of OOP Data Abstraction and Encapsulation Data Abstraction and Encapsulation o The wrapping up of data and functions into a single unit is known as encapsulation. o The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. o These functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding. continue …

Learners Support Publications Basic Concepts of OOP Data Abstraction and Encapsulation Data Abstraction and Encapsulation The attributes wrapped in the classes are called data members and the functions that operate on these data are called methods or member functions. Since the classes use the concept of data abstraction, they are known as Abstracted Data Types (ADT). continue …

Learners Support Publications Basic Concepts of OOP Inheritance Inheritance o Inheritance is the process by which objects of one class acquire the properties of objects of another class. o It supports the concept of hierarchical classification. o Each derived class shares common characteristics with the class from which it is derived. continue …

Learners Support Publications Property Inheritance Bird Attributes: Feathers Lay eggs Flying Bird Attributes: Non-flying Bird Attributes: Robin Attributes: Swallow Attributes: Penguin Attributes: Kiwi Attributes:

Learners Support Publications Basic Concepts of OOP Inheritance Inheritance o Inheritance provides the idea of reusability. o We can add additional features to an existing class without modifying it. (By deriving new class from existing one. The new class will have the combined features of both the classes.) (By deriving new class from existing one. The new class will have the combined features of both the classes.) continue …

Learners Support Publications Basic Concepts of OOP Polymorphism - ability to take more than one form Polymorphism - ability to take more than one form o An operation may exhibit different behaviours in different instances. o The behaviour depends upon the types of data used in the operation. o add( 3, 5) gives 8 o Add(“hello”, “-world”) gives “hello-world” continue …

Learners Support Publications Basic Concepts of OOP Polymorphism - ability to take more than one form Polymorphism - ability to take more than one form o The process of making an operator to exhibit different behaviours in different instances is known as operator overloading. o << Insertion Operator o << Left-shift bit-wise operator o Using a single function name to perform different types of tasks is known as function overloading. o add( 3, 5) gives 8 o Add(“hello”, “-world”) gives “hello-world” continue …

Learners Support Publications Basic Concepts of OOP Dynamic Binding Dynamic Binding Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding ( late binding ) means that the code associated with a given procedure call is not known until the time of the call at run-time. It is associated with polymorphism and inheritance. continue …

Learners Support Publications Basic Concepts of OOP Message Passing Message Passing o An oop consists of a set of objects that communicate with each other. o Oop involves the following steps: o Creating classes that define objects and their behaviour. o Creating objects from class definitions. o Establishing communication among objects. o Objects communicate with one another by sending and receiving information. continue …

Learners Support Publications Basic Concepts of OOP Message Passing Message Passing o A message for an object is a request for execution of a procedure. o The receiving object will invoke a function and generates results. o Message passing involves specifying: o The name of the Object. o The name of the Function. o The information to be send. continue …

Learners Support Publications Benefits of OOP Inheritance – eliminate redundant code and extend the use of existing classes. Inheritance – eliminate redundant code and extend the use of existing classes. We can build programs from the standard working module, no need of starting from the scratch. We can build programs from the standard working module, no need of starting from the scratch. Data hiding helps the programmer to build secure programs that can not be invaded by code in other parts of the program. Data hiding helps the programmer to build secure programs that can not be invaded by code in other parts of the program.

Learners Support Publications Benefits of OOP Multiple instances of an objects can co- exists with out any interference. Multiple instances of an objects can co- exists with out any interference. It is easy to partition the work in a project based on objects. It is easy to partition the work in a project based on objects. Object-oriented system can be easily upgraded from small to large systems. Object-oriented system can be easily upgraded from small to large systems. Message passing techniques for communication between objects makes the interface descriptions with external systems much simpler. Message passing techniques for communication between objects makes the interface descriptions with external systems much simpler. Software complexity can be easily managed. Software complexity can be easily managed. continue …

Learners Support Publications Thank You