BASIC CONCEPT OF OOP

Similar documents
CHAPTER 5 GENERAL OOP CONCEPTS

Object Oriented Programming. C++ 6 th Sem, A Div Ms. Mouna M. Naravani

Data Structures and Programming with C++

OBJECT ORIENTED PROGRAMMING

Unit - IV CHAPTER - 13 INTRODUCTION TO OOP WITH C++ Part 1 Choose the best answer

Object Oriented Programming using C++

Elementary Concepts of Object Class

Object oriented programming Concepts

1. Write two major differences between Object-oriented programming and procedural programming?

Object Orientated Analysis and Design. Benjamin Kenwright



What is a Programming Paradigm

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming :

Unit 1 : Principles of object oriented programming

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING


Data Abstraction. Hwansoo Han

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

What are the characteristics of Object Oriented programming language?

PROGRAMMING LANGUAGE 2

Part 7 - Object Oriented Concepts Classes, Objects, Properties and Methods

Classes, objects, methods and properties

What is Object-Oriented Programming

Introduction to Scientific Programming in C++

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Get Unique study materials from

Object-Oriented Programming

PC204. Lecture 5 Programming Methodologies. Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved.

Object Oriented Pragramming (22316)

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

INHERITANCE: EXTENDING CLASSES

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

Chapter 5 Object-Oriented Programming

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Principles of Programming Languages. Objective-C. Joris Kluivers

Programming Languages & Paradigms PROP HT Course Council. Subprograms. Meeting on friday! Subprograms, abstractions, encapsulation, ADT

Unit 6 - Software Design and Development LESSON 7 CODE STRUCTURES

PROGRAMMING IN C++ COURSE CONTENT

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design


JAVA MOCK TEST JAVA MOCK TEST II

Selenium Online Training Brochure

Examples. Object Orientated Analysis and Design. Benjamin Kenwright

CSCI 253. Outline. Background. George Blankenship 1

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

G Programming Languages Spring 2010 Lecture 9. Robert Grimm, New York University

Data Structures (list, dictionary, tuples, sets, strings)

AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz

Basics of Object Oriented Programming FCITR MAGAZINE DR. SHAKEEL AHMAD

Introduction to Object-Oriented Programming

G Programming Languages - Fall 2012

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

JAVA: A Primer. By: Amrita Rajagopal

Sri Vidya College of Engineering & Technology

Programmazione. Prof. Marco Bertini

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

Object-Oriented Programming (OOP) Fundamental Principles of OOP

What is a class? Responding to messages. Short answer 7/19/2017. Code Listing 11.1 First Class. chapter 11. Introduction to Classes

A STUDY OF OBJECT ORIENTED ANALYSIS AND DESIGN

Java Object Oriented Design. CSC207 Fall 2014

Microsoft Visual Basic 2005: Reloaded

Lecture 23: Object Lifetime and Garbage Collection

Object Oriented Technology

Microsoft Visual Basic 2005: Reloaded

Goals of design. satisfies problem requirements, usable error free, resistant to incorrect input. readable, not purposefully cryptic.

Compaq Interview Questions And Answers

Programming, numerics and optimization

Objective-C: An Introduction (pt 1) Tennessee Valley Apple Developers Saturday CodeJam July 24, 2010 August 7, 2010

From Module To Objects

Object Oriented Programming

Example: Fibonacci Numbers

Chapter 1: Programming Principles

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Object Oriented Programming with Java. Unit-1

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Study of Component Based Software Engineering

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

IT101. Inheritance, Encapsulation, Polymorphism and Constructors

Cosmology with python: Beginner to Advanced in one week. Tiago Batalha de Castro

Object Oriented Programming

An Introduction to Software Engineering. David Greenstein Monta Vista High School

Subtyping (Dynamic Polymorphism)

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed

CLASSES AND OBJECTS IN JAVA

Object Oriented Concepts. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

Element: Relations: Topology: no constraints.

Jaipur National University, Jaipur Dr. Rajendra Takale Prof. and Head Academics SBPIM, Pune

Object Oriented Programming with c++ Question Bank

Solved Question Paper June 2017

Introduction to Java and OOP. Hendrik Speleers

About Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

Chapter 8: Class and Method Design

Introduction to Java Programming CPIT 202. WEWwwbvxnvbxmnhsgfkdjfcn

Transcription:

Chapter-6 BASIC CONCEPT OF OOP Introduction: Object oriented programmingg is the principle of design and development of programs using modular approach. Object oriented programmingg approach provides advantages in creation and development of software for real life application. The basic element of object oriented programming is the data. The programs are built by combining data and functions that operate on the data. Some of the OOP s languages are C++, Java, C #, Smalltalk, Perl, and Python. Procedural programming: The procedural programming focuses on processing of instructions in order to perform a desired computation. Therefore it emphasizes more on doing things like algorithms. This programming is lengthy, increases the complexity of program, difficult to understand and modify the program. This technique is used in a conventional programming language such as C and Pascal. Structured programming: An organized approach to programming involving the use of three basic control structures Sequence, Conditional and loop. The top-down concepts to decompose main functions into lower level components for modular coding purpose. The major drawback is that it is very difficult to model the real world scenario using this model. Object oriented programming: Object oriented programmingg (OOP) is a concept that combines both the data and the functions that operate on that data into a single unit called the object. An object is a collection of set of data known as 1 P a g e

member data and the functions that operate on these data known as member function. OOP follows bottom-up design technique. Class is the major concept that plays important role in this approach. Class is a template that represents a group of objects which share common properties and relationships. Difference between Procedural Programming & Object Oriented programming: Procedural Programming Large programs are dividedd into smaller programs known as functions Data is not hidden and can external functions be accessed by Follow top down approach in the program design Data may communicate with each other through functions Emphasize is on proceduree rather than data Object Oriented Programming Programs are divided into objects Data is hidden and cannot external functions Follows bottom-up approach in the program design Objects may communicate with each other through functions. Emphasize is on data rather than procedure be accessed by Basic Concepts of OOP s: The following are the major characteristics of OOP s: Objects Class Data abstraction Data encapsulation Inheritance Overloading Polymorphism Dynamic Binding Message Passing Important 2 P a g e

Objects Objects are basic building blocks for designing programs. An object is a collection of data members and associated member functions. An object may represent a person, place or a table of data. Each object is identified by a unique name. Each object must be a member of a particular class. Example: Apple, orange, mango are the objects of class fruit. Objects take up space in memory and have address associated with them. At the time of execution of a program, the objects interact by sending the messages to one another. The objects can interact with one another without having to know details of data or functions within an object. Classes: The objects can be made user defined data types with the help of a class. A class is a collection of objects that have identical properties, common behavior and shared relationship. Once class is defined, any number of objects of that class is created. Classes are user defined dataa types. A class can hold both data and functions. For example: Planets, sun, moon are member of class solar system. Data Abstraction: Data Abstraction refers to the process of representing essential features without including background details or explanations. Data Encapsulation: The wrapping of data and functions into a single unit (class) is called data encapsulation. Data encapsulation enables data hiding and information hiding. 3 P a g e

Data hiding is a method used in object oriented programming to hide information within computer code. Inheritance: Inheritance is the process by which one object can acquire and use the properties of another object. The existing class is known as base class or super class. The new class is known as derived class or sub class. The derived class shares some of the properties of the base class. Therefore a code from a base class can be reused by a derived class. Overloading: Overloading allows objects to have different meaning depending upon context. There are two types of overloading viz. o Operator Overloading o Function Overloading When an existing operator operates on new data type is called operator overloading. Function overloading means two or more function have same, but differ in the number of arguments or data type of arguments. Polymorphism: The ability of an operator and function to take multiple forms is known as Polymorphism. The different types of polymorphism are operator overloading and function overloading. Dynamic binding: Binding is the process of connecting one program to another. Dynamic binding is the process of linking the procedure call to a specific sequence of code or function at run time or during the execution of the program. Message Passing: In OOP s, processing is done by sending message to objects. A message for an object is request for execution of procedure. 4 P a g e

Message passing involves specifying the name of the object, the name of the function (message) and the information to be sent. Important Advantage of OOP s The programs are modularized based on the principles of classes and objects. Linking code & object allows related objects to share common code. This reduces code duplication and code reusability. Creation and implementation of OOP code is easy and reduces software development time. The concept of data abstraction separates object specification and object implementation. Data encapsulated along with functions. Therefore external non-member function cannot access or modify data, thus proving data security. Easier to develop complex software, because complexity can be minimized through inheritance. OOP can communicate through message passing which makes interface description with outside system very simple. Disadvantage of OOP s Larger program size: OOP s typically involves more lines of code than procedural programs. Slower Programs: OOP s typically slower than procedure based programs, as they typically require more instructions to be executed. Not suitable for all types of programs. To convert a real world problem into an object oriented model is difficult. OOP s software development, debugging and testing tools are not standardized. Polymorphism and dynamic binding also requires processing time, due to overload of function calls during run time. Application of OOP s Computer graphics applications..cad/cam software Object-oriented database. User-Interface design such as windows Real-time systems. Simulation and Modeling Artificial intelligence and expert systems. Client-Server Systems. 5 P a g e

CHAPTER 6 Basic Concept of OOP s BLUE PRINT VSA (1 marks) SA (2 marks) LA (3 Marks) Essay (5 Marks) Total - 01 Question - 01 Question 02 Question - Question No 13 Question No 30 07 Marks Important Questions 2 Marks Question: 1. Explain: Classes, Objects, Data Abstraction, Data Encapsulation, Inheritance, and Polymorphism. 2. What is Base class and derived class? 5 Marks Question: 1. Distinguish between procedural and object oriented programming. 2. Explain the characteristics of OOP s. 3. Briefly explain the basic concepts of OOP s. 4. Explain the advantages of OOP s. 5. Mention disadvantages of OOP s. 6. Write the applications of OOP s. 6 P a g e