Object Oriented Programming
Eg: C++, Java, etc.
Features of OOPS
Objects
Classes
Data abstraction
Data encapsulation
Inheritance
Polymorphism
Dynamic binding
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
Advantages of OOPS
Application of OOPs
- Programming paradigm that represents the concept of "objects" that have data fields (attributes that describe the object) and associated procedures known as methods
- Programming methodology based on objects, instead of just functions and procedures
- Focuses on data rather than process
- As individual objects can be modified without affecting other aspects of the program, it is easier for programmers to structure and organize software programs
- Easier to update and change programs written in object-oriented languages
- Simula was the first object oriented programming language
Eg: C++, Java, etc.
Features of OOPS
Objects
- Referred as instance of class
- 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
- They occupy space in memory that keeps its state
- Each object contains data and code to manipulate the data
Classes
- 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
- Objects of the same class share the same properties
Data abstraction
- act of representing essential-features without including the details or explanations.
- Provides the outside view of the object
- Separation of essential behavior form its implementation
- Since the classes use the concept of data abstraction, they are known as Abstract Data Types (ADT)
Data encapsulation
- Mechanism of binding the data and the codes (which manipulate the data) together
- 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
- Acts like a protective wall.
Inheritance
- process by which objects of one class acquire the properties of objects of another class
- Helps in reducing the code size as common codes can be kept in a single class called base class
- Emphasizes on code reusability
- Feature of parent class are extracted by the derived (child) class.
Polymorphism
- ability to take more than one form
- Derived from Greek word “poly-morphs” meaning many forms
- An operation may exhibit different behavior in different situations depending upon the types of data used in the protram.
Dynamic binding
- 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
- Making the operator perform operations differently on the user defined data type (classes)
- 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
- Inheritance
- Code reusability
- Time saving and higher productivity
- Higher security (data hiding)
- Easy partition and distribution of work
Application of OOPs
- Real time Systems
- Simulation and Modeling
- Hypertext and Hypermedia
- Decision support system
- CAM/CAE/CAD System
- Office Automation System
- AI and expert system
Comments
Post a Comment