0% found this document useful (0 votes)
36 views

OOP

Object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design applications and computer programs. OOP relies on classes and objects, where classes serve as blueprints for objects that contain data attributes and methods. The main principles of OOP include encapsulation, abstraction, inheritance, and polymorphism. OOP offers benefits like modularity, reusability, flexibility, and easier maintenance of code. Popular OOP languages include Java, C++, and Python.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

OOP

Object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design applications and computer programs. OOP relies on classes and objects, where classes serve as blueprints for objects that contain data attributes and methods. The main principles of OOP include encapsulation, abstraction, inheritance, and polymorphism. OOP offers benefits like modularity, reusability, flexibility, and easier maintenance of code. Popular OOP languages include Java, C++, and Python.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

OBJECT ORIENTED

PROGRAMMING

OOP
ADVANTAGES OF OOP

STRUCTURE OF OOP

MAIN PRINCIPLES OF
OOP

BENEFITS OF OOP
Introduction
OBJECT- MAIN PRINCIPLES BENEFITS OF OOP

OOP
ORIENTED OF OOP
• Modularity
PROGRAMMING • Encapsulation
• Reusability
• Abstraction
• Productivity
STRUCTURE OF • Inheritance
OOP • Easily upgradable
• Polymorphism and scalable
• Classes
• Objects • Interface
descriptions
• Methods
• Security
• Attributes
• Flexibility
OBJECT ORIENTED PROGRAMMING
OOP is a computer programing model that organizes software design around data, or
objects, rather than functions and logic.

OOP relies on the concept of classes and objects.

OOP is a methodology or paradigm to design a program using classes and objects.

The popular object-oriented languages are Java, C#, PHP, Python, and C++.
What are examples of OOP languages?
Simula is considered the first object-oriented programming language.

• Note: The programming paradigm where everything is represented as


an object is known as a truly object-oriented programming
language.

• Smalltalk is considered the first truly object-oriented programming


language.
What are examples of OOP languages?

Popular PURE OOP languages include Ruby, Scala, JADE and Emerald.

Programming languages designed PRIMARILY for OOP include Java, Python and C++.

Other programming languages that PAIR with OOP include VB.NET, PHP and JavaScript.
STRUCTURE OF OOP
• CLASSES

• OBJECTS

• METHODS

• ATTRIBUTES
STRUCTURE OF OOP
The structure, or building blocks, of OOP include the following:

 Classes are user-defined data types that act as the blueprint for individual objects,
attributes and methods.

 Collection of objects is called class. It is a logical entity.


 A class can also be defined as a blueprint from which you can create an individual
object. Class doesn't consume any space.
 Class contain fields for attributes and methods for behavior.

We have DOG class example, attributes include NAME and BIRTHDAY, while methods
include BARK.
STRUCTURE OF OOP
 Objects are instances of a class created with specifically defined data.
 Objects can correspond to real-world objects or an abstract entity. When class is
defined initially, the description is the only object that is defined.
 Objects are instances of a class created with a specific data.
 Any entity that has state and behavior is known as an object.

We have DOG class example, BROWNY is an instance of the DOG class.


• BROWNY is an object because it has states like color, name, breed, etc.
as well as behaviors like wagging the tail, barking, eating, etc.
STRUCTURE OF OOP
 Methods are functions that are defined inside a class that describe the behaviors of an
object.
 Methods represents behaviors.
 Methods might return information about an object or update an object’s data.
 Additionally, the subroutines contained in an object are called instance methods.
 Programmers use methods for reusability or keeping functionality encapsulated inside
one object at a time.
We have DOG class example, BROWNY is an instance of the DOG class. We have
barking and eating as the behavior of BROWNY.
STRUCTURE OF OOP
 Attributes are defined in the class template and represent the state of an object.

 Objects will have data stored in the attributes field.

We have DOG class example, BROWNY is an instance of the DOG class. We have
barking and eating as the behavior of BROWNY. BROWN and LABRADOR
RETRIEVER is the attribute of Browny.
MAIN PRINCIPLES
OF OOP
ENCAPSULATION
− This principle states that all important information is contained inside an object and only select
information is exposed.

− The implementation and state of each object are privately held inside a defined class.

− Other objects do not have access to this class or the authority to make changes.

− They are only able to call a list of public functions or methods.

− This characteristic of data hiding provides greater program security and avoids unintended data
corruption.

− Binding (or wrapping) code and data together into a single unit are known as encapsulation. For
example, a capsule, it is wrapped with different medicines.
ABSTRACTION
− Objects only reveal internal mechanisms that are relevant for the use of other
objects, hiding any unnecessary implementation code.

− The derived class can have its functionality extended.

− This concept can help developers more easily make additional changes or additions
over time.

− Hiding internal details and showing functionality is known as abstraction.

− For example, phone call, we don't know the internal processing.


INHERITANCE
− Classes can reuse code from other classes.

− Relationships and subclasses between objects can be assigned, enabling developers


to reuse common logic while still maintaining a unique hierarchy.

− This property of OOP forces a more thorough data analysis, reduces development
time and ensures a higher level of accuracy.

− When one object acquires all the properties and behaviors of a parent object, it is
known as inheritance.
POLYMORPHISM
− Objects are designed to share behaviors and they can take on more than one form.

− The program will determine which meaning or usage is necessary for each execution of that object from a
parent class, reducing the need to duplicate code.

− A child class is then created, which extends the functionality of the parent class.

− Polymorphism allows different types of objects to pass through the same interface.

− If one task is performed in different ways, it is known as polymorphism.

− For example, to convince the customer differently, to draw something, for example, shape, triangle,
rectangle, etc.

− Another example can be to speak something; for example, a cat speaks meow, dog barks woof, etc.
BENEFITS OF OOP
• Modularity
• Interface
• Reusability descriptions

• Productivity • Security

• Easily • Flexibility
upgradable
and scalable
MODULARITY
− Encapsulation enables objects to be self-contained,
making troubleshooting and collaborative
development easier.
− Modularity is a concept in object-oriented

BENEFITS
programming that allows us to divide a complex
problem into smaller and manageable modules

OF OOP
REUSABILITY
− Code can be reused through inheritance, meaning
a team does not have to write the same code
multiple times.
− Reusability in OOP is the concept of using existing

BENEFITS
code to create new classes or objects.
− Reusability reduces redundancy and repetition in
code and facilitates the quick development and
testing of programs.

OF OOP
− One way to achieve reusability in OOP is through
inheritance, which allows a new class to inherit
the properties and methods of an existing class.
PRODUCTIVITY
− Programmers can construct new programs
quicker through the use of multiple libraries and
reusable code.

BENEFITS
OF OOP
EASILY UPGRADABLE AND ACCESSIBLE

− Programmers can implement system


functionalities independently.

BENEFITS
OF OOP
INTERFACE DESCRIPTIONS
− Descriptions of external systems are simple, due
to message passing techniques that are used for
objects communication.

BENEFITS
OF OOP
SECURITY
− Using encapsulation and abstraction, complex
code is hidden, software maintenance is easier
and internet protocols are protected.

BENEFITS
OF OOP
FLEXIBILITY
− Polymorphism enables a single function to adapt to
the class it is placed in.
− Different objects can also pass through the same
interface.

BENEFITS
OF OOP
REFERENCES

https://www.javatpoint.com/java-oops-concepts

https://www.techtarget.com/searchapparchitecture/
definition/object-oriented-programming-OOP
THANK YOU!

You might also like