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

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...

Network Topology

A network topology is the arrangement of the computers cable and other components on a network. The major goal of network topology is to find out the most economical and efficient way to connect all the users to the network resources while providing adequate capacity to handle users demand, maintain system reliability and decrease the delay.    Topology is the map of physical network. The type of topology we use defect the type and capabilities network hardware’s its management and possibilities for future expansion. There are many types of network topology, some of these are:   Bus Topology Star Topology Mesh Topology   Ring Topology Tree Topology

What is Servlet in Java?

A servlet is a small program that executes on a server. Just as applets dynamically extend the functionality of a web browser, servlets dynamically extend the functionality of a web server. It is helpful to understand that as useful as applets can be, they are just one half of the client/server equation. Not long after the initial release of Java, it became obvious that Java would also be useful on the server side. The result was the servlet. Thus, with the advent of the servlet, Java spanned both sides of the client/server connection.