Looks like you're stuck. Need a hand?

Share This Tutorial

Views 8

BTEC Computing L3 - Object Oriented Programming (OOP)

Date  |  Category Computer Science
...
...
Learning Paths Learning Paths

Object Oriented Programming is one of the biggest topics in Unit 1. It comes up in every exam because it completely changes how software is designed, structured and reused. This tutorial gives you a clear, exam-ready understanding of the full paradigm: classes, objects, attributes, methods, inheritance, encapsulation, polymorphism, overloading, data hiding and reusability.

What OOP Actually Is

OOP is a programming model that organises software around objects, not just functions. An object stores data and the code that works on that data in one place. Instead of writing separate functions and variables for everything, you create reusable blueprints called classes, then generate objects from them.

This lets you build complex systems by modelling real or abstract things: users, animals, vehicles, bank accounts, anything.

Classes and Objects

These two terms are the foundation of OOP.

Class
A blueprint. It defines what attributes an object has and what methods it can perform.

Object (Instance)
A real version created from the class. If the class is “Human”, an object might be “Bob”, with his own age, name and actions.

Examiners expect you to explain:
A class defines structure and behaviour. An object is a single instance of that definition.

Attributes and Methods

Attributes
Variables stored inside an object. They represent state, for example name, age, speed or balance.

Methods
Functions inside the class. They define what the object can do.
Example: speak(), walk(), accelerate(), deposit().

Attributes = data.
Methods = behaviour.
Objects = data + behaviour combined.

Constructors

A constructor is a special method that runs when the object is created. It sets initial attribute values.

Example exam-style definition:
A constructor initialises an object’s attributes when the object is instantiated.

Instantiation

Instantiation is the process of creating an object from a class.

Example:
bob = Human("Bob", 25)

This creates an object with its own attributes and methods, independent of other objects.

The Four Core OOP Principles (must know for exams)

1. Abstraction

Abstraction hides unnecessary complexity. It focuses on the essential qualities of an object. Users interact with simple methods without needing to know how they work internally.

Example: calling car.start() without knowing how the engine system works.

2. Encapsulation

Encapsulation bundles data and methods inside a class and restricts direct access to internal details. It prevents unwanted interference and protects the object’s integrity.

Key idea: only the class itself should manage its own data.

3. Inheritance

Inheritance allows one class (child subclass) to reuse the attributes and methods of another class (parent superclass).

Example:
Vehicle → Car → SportsCar

Child classes inherit behaviour but can also override or extend it.

4. Polymorphism

Polymorphism means “many forms”. Different classes can share the same method name but behave differently.

Two main types:
Overriding (dynamic): a child class changes how a parent method behaves.
Overloading (static): multiple methods share the same name but accept different parameter lists.

Overloading

Overloading is when a class has multiple methods with the same name but different argument patterns. The correct version is picked based on the number or type of arguments.

Python does not support true overloading natively, but the concept is examinable.

Data Hiding

Data hiding restricts how attributes are accessed. It protects internal data so it cannot be changed in unsafe ways.

Common access levels: - Public
- Protected
- Private

Exam definition:
Data hiding prevents direct access to sensitive internal attributes, enforcing control through methods.

Reusability

OOP naturally supports code reuse. You can create multiple objects from one class, or extend existing classes through inheritance. This reduces development time and improves maintainability.

Why OOP is Used

OOP is ideal for: - Large applications
- GUI systems
- Games
- Any program with complex, real-world models
- Systems that need modular, maintainable code
- Scenarios where reusability matters

OOP encourages cleaner structure, reduces duplication and supports long-term development.

Exam-Style Explanation Points

To hit top marks, your answers should show that you understand:

What OOP is
A paradigm that organises code into classes and objects.

Why it is used
Reusability, maintainability, modularity, organisation of complex systems.

Structure
Classes, objects, constructors, attributes, methods.

Features
Inheritance, encapsulation, polymorphism, abstraction, overloading, data hiding.

Applications
Any scenario needing reusable, modular or scalable design.

Comparison
OOP is different from procedural programming because the focus shifts from functions to objects that store their own data and behaviour.

Summary

Object Oriented Programming makes software easier to organise, maintain and reuse. By modelling “things” instead of writing endless functions, you simplify large systems and make code more manageable. Examiners expect you to define key principles, give examples and explain why OOP is useful in real applications.