GROUP 4
OBJECT-ORIENTED
PROGRAMMING (OOP)
GROUP MEMBERS
Keren-Happuch Koran-Gyamfi
Olabisi Michael Akinola
David Yaw Andoh
What is Object Oriented
Programming?
Object Oriented programming (OOP) is a programming paradigm that
relies on the concept of classes and objects. It is used to structure a
software program into simple, reusable pieces of code blueprints
(usually called classes), which are used to create individual instances
of objects. There are many object-oriented programming languages
including JavaScript, C++, Java, and Python.
Principles of OOP
Encapsulation. The implementation and state of each object are
privately held inside a defined boundary, or class. Other objects do
not have access to this class or the authority to make changes but 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.
Principles of OOP Cont’d
Abstraction. Objects only reveal internal mechanisms that are
relevant for the use of other objects, hiding any
unnecessary implementation code. This concept helps developers
more easily make changes and additions over time.
Principles of OOP Cont’d
Inheritance. Relationships and subclasses between objects can be
assigned, allowing developers to reuse a 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.
Principles of OOP Cont’d
Polymorphism. Objects can take on more than one form depending
on the context. The program will determine which meaning or usage
is necessary for each execution of that object, cutting down the need
to duplicate code.
Benefits of OOP
OOP models complex things as reproducible, simple structures
Reusable, OOP objects can be used across programs
Allows for class-specific behaviour through polymorphism
Easier to debug, classes often contain all applicable information to them
Secure, protects information through encapsulation
Building blocks of OOP
A class is an abstract blueprint used to create more specific, concrete objects.
Classes often represent broad categories, like Car or Dog that share attributes.
These classes define what attributes an instance of this type will have,
like colour, but not the value of those attributes for a specific object. Classes
can also contain functions, called methods available only to objects of that
type. These functions are defined within the class and perform some action
helpful to that specific type of object.
Building blocks of OOP Cont’d
Objects are instances of classes. Objects sometimes correspond to
things found in the real world. For example, a graphics program may
have objects such as "circle", "square", "menu". An online shopping
system might have objects such as "shopping cart", "customer", and
"product". Sometimes objects represent more abstract entities, like an
object that represents an open file, or an object that provides the
service of translating measurements from U.S. customary to metric.
Building blocks of OOP Cont’d
Attributes are the information that is stored. Attributes are defined in
the class template. When objects are instantiated individual objects
contain data stored in the Attributes field.
The state of an object is defined by the data in the object’s attributes
fields. For example, a puppy and a dog might be treated differently at pet
camp. The birthday could define the state of an object, and allow the
software to handle dogs of different ages differently.
Building blocks of OOP Cont’d
A method in object-oriented programming (OOP) is a procedure
associated with a message and an object. This allows the
sending objects to invoke behaviours and to delegate the
implementation of those behaviours to the receiving object.
A method in Java programming sets the behaviour of a class object.
Object-oriented programming languages
While Simula is credited as the first object-oriented programming language, the most
popular OOP languages are: Visual Basic.NET, Ruby, Scala, PHP Java, JavaScript,
Python, C++.
OOPSLA is the annual conference for Object-Oriented Programming Systems,
Languages and Applications.