Chapter 1 Basics of OOP
Chapter 1 Basics of OOP
Chapter 1 Basics of OOP
Syllabus
UNIT-I: Introduction to Object Oriented Programming UNIT-II: Programming with C++ UNIT-III: Classes and Objects UNIT-IV: Operator Overloading UNIT-V: Inheritance and Polymorphism UNIT-VI: Templates UNIT-VII: Exception Handling UNIT-VIII: Files and Streams
ext Books:
nowledge of C Language
eys of OOP What is OOP? OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.).
Technique of hierarchical decomposition has been used to specify the tasks to be completed for solving the problem
eys of OOP What is Procedural Programming Languages/Procedure oriented Programming (POP) ? Concentration on the development of function. What about data?
Data items are placed global. Global data are vulnerable to an inadvertent change by a function.
eys of OOP Drawbacks of Procedural Programming Languages/Procedure oriented Programming (POP) Large program , difficult to identify what data is used by what function. Revise an external data structure, revise all functions that access the data, bugs to creep in. Doesn't model real life problems very well. Functions are action-oriented and do not really corresponds to the elements of the problem.
eys of OOP
eys of Oriented Paradigm Object OOP Motivating factor is to remove the flaws in the POP. OOP treats data as the critical element in the program development , does not allow to flow freely around the system. Decomposition of the problem into a number of entities called objects and then built data and function around these object.
eys of OOP
eys of OO Programming anguages that are based on classes are know as ObjectOriented. Eiffel C++ Modula-3 Ada 95 Java
Object Oriented Programming as an approach that provides a way of modularizing programs by creating partitioned memory area for both data and function that can be used as template for creating copies of such modules on demand
asics of OOP
oncepts used extensively in OOP Objects Classes Data abstraction and encapsulation Inheritance Polymorphism Dynamic binding Message passing
The principle behind this sort of division is that each derived class shares common characteristics with the class from which it is derived. Provides an opportunity to reuse the code functionality and fast implementation time. When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of an existing class.
What is OOP? OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects". Hence, you gain re-usability by means of four main object-oriented programming concepts. In order to clearly understand the object orientation, lets take your hand as an example. The hand is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.