Вы находитесь на странице: 1из 2

Object Oriented Programming or OOP

- is a technique to create programs based on real world.


- Here in the OOP programming model programs are organized around objects. Among all
of the OOPs Concepts, some concepts are very important in real time; those are
Polymorphism, Inheritance, Abstraction and Encapsulation.
Keywords/Concepts in OOPS:
1. Object
2. Method
3. Class
4. Instance
5. Message Parsing
6. Abstraction
7. Inheritance
8. Data Encapsulation
9. Polymorphism

6. Object:-
Objects have states and behaviours. Example: A dog has states-colour, name, breed as well
as behaviours -wagging, barking, and eating. An object is an instance of a class.

7. Class:- A class can be defined as a template/ blue print that describe the
behaviours/states that object of its type support.

6. Abstraction:-Hiding non-essential features and showing the essential features (or)


Hiding unnecessary data from the users details, is called abstraction.
Real Time example: TV Remote Button
In that number format and power buttons and other buttons there. We are seeing just the
buttons, we don't see the button circuits. i.e. buttons circuits and wires all are
hidden.so I think its good example.
8. Encapsulation: It is a process of binding or wrapping the data and the codes that
operates on the data into a single entity. This keeps the data safe from outside interface
and misuse. One way to think about encapsulation is as a protective wrapper that prevents
code and data from being arbitrarily accessed by other code defined outside the wrapper.
Real Time Example: 1.Ink is the important component in pen but it is hiding by some other
material
Real Time example: Medical Tablet
i.e. one drug is stored in bottom layer and another drug is stored in Upper layer these
two layers are combined in single Tablet.
7. Inheritance: The new classes, known as derived classes, take over (or inherit)
attribute and behaviour of the pre-existing classes, which are referred to as base classes
(or Parent classes).
In Oracle with PLSQL language implemented in D2K, we can use principle of INHERITANCE by
using Libraries which is oops concept.
It is intended to help reuse existing code with little or no modification.
Real Time Example: Father and Son Relationship
9. Polymorphism: Single Form behaving differently in different Situations. A single
function or single operator has different characters in different places.
Real Time Example:
1. A girl plays a role of daughter at home and a manager at office.
2. Person - Person in Home act is husband/son, in Office acts Employer. In Public Good
Citizen.

Benefits of OOPS:
Using objects & classes helps in bundling. Bundling code into individual software objects
provides a number of benefits, including:
Modularity: The source code for an object can be written and maintained independently of
the source code for other objects. Once created, an object can be easily passed around
inside the system.
Information-hiding: By interacting only with an object's methods, the details of its
internal implementation remain hidden from the outside world.
Code re-use: If an object already exists (perhaps written by another software developer),
you can use that object in your program. This allows specialists to implement/test/debug
complex, task-specific objects, which you can then trust to run in your own code.
Pluggability and debugging ease: If a particular object turns out to be problematic, you
can simply remove it from your application and plug in a different object as its
replacement. This is analogous to fixing mechanical problems in the real world. If a bolt
breaks, you replace it, not the entire machine.
Flexibility and compatibility: OOP provides greater flexibility and compatibility for the
developing larger application.

Вам также может понравиться