The object‑oriented (OO) paradigm models software as a collection of objects that combine data (state) and behaviour (methods). An object is an instance of a class, which defines the structure and capabilities that its objects share.
Key Characteristics
Encapsulation – Bundles data and the methods that manipulate that data within a single unit, hiding internal details from the outside world.
Inheritance – Allows a new class (sub‑class) to acquire the attributes and methods of an existing class (super‑class), promoting reuse and hierarchical relationships.
Polymorphism – Enables a single interface to represent different underlying forms (e.g., method overriding or overloading), allowing objects of different classes to be treated uniformly.
Abstraction – Provides a simplified model of complex reality by exposing only essential features and suppressing irrelevant details.
Typical OO Constructs
Below is a generic class definition in a Java‑like syntax, illustrating the four characteristics.
\$\$\begin{aligned}
\textbf{class}\; \text{Vehicle} \{\\
\quad \text{private}\; String\; make;\\
\quad \text{private}\; int\; year;\\
\quad \text{public}\; Vehicle(String m, int y) \{\\
\quad \text{public}\; Car(String m, int y, int d) \{\\
\quad\quad super(m, y);\\
\quad\quad this.doors = d;\\
\quad \}\\
\quad \text{@Override}\\
\quad \text{public}\; void\; start() \{\\
\quad\quad System.out.println("Car ignition");\\
\quad \}\\
\}
\end{aligned}\$\$
Advantages of Object‑Oriented Programming
Improved modularity – each class can be developed and tested independently.
Code reuse through inheritance and composition reduces duplication.
Easier maintenance – changes to a class affect only its objects.
Enhanced readability – concepts map closely to real‑world entities.
Supports polymorphic interfaces, facilitating flexible and extensible designs.
Disadvantages / Limitations
Potential for over‑engineering – excessive use of inheritance can create deep, fragile hierarchies.
Higher memory overhead due to object metadata and indirection.
Learning curve for concepts such as abstraction, polymorphism, and design patterns.
Performance penalty in some contexts compared with procedural code, especially for tight loops.
Common Object‑Oriented Languages
Java
C++
C#
Python (supports multiple paradigms, but widely used OO)
Ruby
Comparison with Other Paradigms (Summary Table)
Aspect
Object‑Oriented
Procedural
Functional
Primary abstraction
Objects (state + behaviour)
Procedures / functions
Pure functions
Data encapsulation
Yes (private/public access)
Limited (global variables)
Immutable data
Reuse mechanism
Inheritance, composition
Modular functions
Higher‑order functions
Polymorphism
Method overriding / overloading
None (except via pointers)
Function composition
Typical use‑case
Large, evolving systems
Simple scripts, system utilities
Mathematical modelling, concurrency
Suggested diagram: Class hierarchy showing \cdot ehicle as a super‑class and Car, Truck as sub‑classes, illustrating inheritance and polymorphic start() method.
Key Points to Remember for the Exam
Define and give examples of encapsulation, inheritance, polymorphism and abstraction.
Explain how OO promotes modularity and reuse.
Identify situations where OO may be less suitable (e.g., memory‑constrained embedded systems).
Be able to read and write simple class definitions and recognise OO concepts in code snippets.