Upcoming SlideShare
Loading in...5







Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Oops Oops Presentation Transcript

  •  Supported languages like C++, C#, Java
  • Examples:- Real world objects Replica in Prog world Bank net banking Shopping mall online shopping Reservation counter online ticket booking
  •  Developing a sw means We are copying the real world objects into the prog world, it means both the objects must look similar to each other.  Non object oriented languages like C failed in creating the exact replica of the real world object in prog world. So that’s why OOPS is invented.  With the following example we can prove, how a non object oriented lang is failed in creating the replica.
  • So firstly will see an example of shopping mall using 1. non object oriented language 2. object oriented language
  • So firstly we analyze a shopping mall In Real World Salesman Cashier Manager Finally we need a collection of objects…
  •  5 Sales Persons  Describes product() speak()  2 Managers  Salaries() speak()  2 Cashiers  bill() speak()
  • Without OOPS or in C language Void main() { Speak(); Salaries(); } String Speak(question) { Return answer; } int salaries(work done) { Return salary; }
  •  In previous code where are those sales persons, managers and cashiers ? Can you locate them????
  • So without OOPS we are able to see  Functions of our shopping mall members  But actual persons are really missing… it means objects are really missing… With OOPS we can see them and we can feel their presence.
  • With OOPS Contd… Class SalesPerson { String DescibesProduct(question) { Return answer; } String Speak(question) { Return answer; } }; Class Cashier { Int bill(products, rate) { Return total bill; } String Speak(question) { Return answer; } };
  • Void main() { Manager Mahesh; Mahesh.Speak(); Cashier Neha; Neha.Bill(); SalesPerson Ram; SalesPerson Sam; SalesPerson Vicky; …etc }
  •  As our software is completely dependent on real world objects, to create exact replica, developers started analyzing the real world objects like pen, car, water bottle etc and finally they learned 4 principles & named them as OOPS.  They finally concluded that, if we satisfy all the 4 principles in our programming language then definitely we can create exact replica of real world objects.
  •  But today we understanding OOPS in programmes but we are failing to analyze it in real world…
  •  Encapsulation  Abstraction  Inheritance  Polymorphism
  •  Every real world object like bag, mobile & pen-drive behaves like a container which is used for the purpose of storing & hiding the things.  This is called encapsulation.  So developers copied this principle in programming & they are achieving encapsulation through a kw called class.
  •  Hiding all the things is not a good idea, so Every real world object like pen-drive is used for some purpose. so exposing those necessary functions is called abstraction.  So developers copied this principle in programming & they are achieving abstraction through a access modifiers.
  •  Each object in the real world is based on their ancestors/parents & they also deriving some common things from them. example:- pen-drive object is derived some storing mechanisms from hard-disk object.  This is called inheritance.  So developers copied this principle in programming & they are achieving inheritance through a colon : symbol.
  •  Each object in the real world behaves according to the situation. example:- a power button of an LCD monitor behaves as a power-off button if monitor is already switched on vice versa.  This is called polymorphism.  So developers copied this principle in programming & they are achieving polymorphism through a overloading & overriding.
  • Advantages:- It is helpful in developing Meaningful code. Maintenance is easy. Mapping with real world Objects.
  • Q. Why it is required? To map software product similar to real life Product. To develop meaningful code. To increase Passion in programming
  • C lang + OOPS= Modified OOPS C C++ Java C##