Skip to main content

Object Oriented Programming

Object Oriented Programming


  1. Programming paradigm that represents the concept of "objects" that have data fields (attributes that describe the object) and associated procedures known as methods
  2. Programming methodology based on objects, instead of just functions and procedures
  3. Focuses on data rather than process
  4. As individual objects can be modified without affecting other aspects of the program, it is easier for programmers to structure and organize software programs
  5. Easier to update and change programs written in object-oriented languages
  6. Simula was the first object oriented programming language


Eg: C++, Java, etc.

Features of OOPS

Objects


  1. Referred as instance of class
  2. Basic run-time entities in an object-oriented system a person, a place, a bank account, a table of data, etc can be an object
  3. They occupy space in memory that keeps its state 
  4. Each object contains data and code to manipulate the data 



Classes


  1. Blue print or prototype  which defines the variables and methods common to all the objects of certain kind user defined data types that behave like the built-in types of a programming language
  2. Objects of the same class share the same properties



Data abstraction


  1. act of representing essential-features without including the details or explanations.
  2. Provides the outside view of the object
  3. Separation of essential behavior form its implementation
  4. Since the classes use the concept of data abstraction, they are known as Abstract Data Types (ADT)



Data encapsulation


  1. Mechanism of binding the data and the codes (which manipulate the data) together
  2. Most important feature of OOPS that prevents outside interference as data is not accessible to the outside world and only those functions that are wrapped in the class can access it
  3. Acts like a protective wall.



Inheritance


  1. process by which objects of one class acquire the properties of objects of another class
  2. Helps in reducing the code size as common codes can be kept in a single class called base class
  3. Emphasizes on code reusability
  4. Feature of parent class are extracted by the derived (child) class.



Polymorphism


  1. ability to take more than one form
  2. Derived from Greek word “poly-morphs” meaning many forms
  3. An operation may exhibit different behavior in different situations depending upon the types of data used in the protram.



Dynamic binding


  1. refers to the linking of a procedure call to the code to be executed in response to the call the code associated with a given procedure call is not known until the time of call at run-time associated with polymorphism and inheritance.



Message passing

refers to the linking of a procedure call to the code to be executed in response to the call
the code associated with a given procedure call is not known until the time of call at run-time
associated with polymorphism and inheritance.

Operator Overloading


  1. Making the operator perform operations differently on the user defined data type (classes)
  2. Suppose A,B ,c are different objects of same class. Then, in C=A+B, “+” can be used to subtract the data of B from A.


Advantages of OOPS


  1. Inheritance
  2. Code reusability
  3. Time saving and higher productivity
  4. Higher security (data hiding)
  5. Easy partition and distribution of work


Application of OOPs


  1. Real time Systems
  2. Simulation and Modeling
  3. Hypertext and Hypermedia
  4. Decision support system
  5. CAM/CAE/CAD System
  6. Office Automation System
  7. AI and expert system







Comments

Popular posts from this blog

Database Management System(DBMS)

Data and Information  Data is an unprocessed raw fact which does  not give complete meaning about any object,person, entity etc. But when various inter-related data arranged in a row, it gives a complete meaning which is referred to as information. For Example: ID Name Address Program 1101 Ram Shrestha Biratnagar BScIT         is information of a specific person. Database Database is a repository(storage) for the organized collection of related information  of data items. It Consist of meaningful arrangement of data, relationship, constraints, schema etc. In modern days we define database as a computerized record-keeping system used to store information and allows users to retrieve and update these information on their request. Some example of databases are telephone directory, data of SLC result, student and employee records etc. Database Management System(DBMS) Database is the softw...

What is Java Applets?

An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. Furthermore, an applet is downloaded on demand, without further interaction with the user. If the user clicks a link that contains an applet, the applet will be automatically downloaded and run in the browser. Applets are intended to be small programs. They are typically used to display data provided by the server, handle user input, or provide simple functions, such as a loan calculator, that execute locally, rather than on the server. In essence, the applet allows some functionality to be moved from the server to the client.

What is manipulator in C++?

Answer: Manipulators are special functions that can be included in the I/O statement to alter the format parameters of a stream. Table-2 shows some important manipulator functions that are frequently used. To access these manipulators, the file < iomanip.h > should be included in program.                               Table-2               Manipulators                                                    Equivalent ios function               set...