What are the core ideas of object-oriented programming?
Understand classes and objects, attributes and methods, instantiation, encapsulation, inheritance and polymorphism, and the principle of object-oriented design.
A focused answer to AQA A-Level Computer Science 4.1.5, covering classes and objects, attributes and methods, instantiation, encapsulation, inheritance and polymorphism, and the benefits of object-oriented design.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to define classes and objects, attributes and methods, explain instantiation, and describe encapsulation, inheritance and polymorphism, with the benefits of object-oriented design.
Classes and objects
CLASS Animal
PRIVATE name
PUBLIC PROCEDURE makeSound()
OUTPUT "..."
ENDPROCEDURE
ENDCLASS
dog = NEW Animal() # instantiation: dog is an object
The distinction is like a cutter and the biscuits it stamps out: the class is written once and describes the shape, while many objects can be instantiated from it, each holding its own data. A Student class might be used to create thousands of student objects, all sharing the same methods but each with its own name and marks. Attributes are the data fields; methods are the subroutines that belong to the class and act on that data.
Encapsulation
Inheritance and polymorphism
Polymorphism is what lets a single loop call makeSound() on a list of mixed Animal objects and have each respond correctly, a dog barking and a cat meowing, without the loop needing to know which is which. This is powerful because new subclasses (a Cow) can be added later and the existing loop works with them unchanged, as long as they provide the expected method.
Benefits of object-oriented design
OOP models real-world entities directly, which makes large programs easier to design and understand because the code structure mirrors the problem. Encapsulation improves maintainability and protects data; inheritance reduces duplicated code by sharing common behaviour; polymorphism allows flexible, extensible code that works with new subclasses without change. A useful guiding principle is to encapsulate what varies behind clear interfaces, so that changes are localised and the rest of the program is insulated from them. These benefits are why OOP is the dominant paradigm for large software systems.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20194 marksA program models vehicles. A Vehicle class has attributes and methods, and a Car class is derived from it. Explain how inheritance is used here and describe one benefit of using inheritance in this design.Show worked answer →
Inheritance lets the Car class (the subclass) derive the attributes and methods of the Vehicle class (the superclass), so a Car automatically has the general vehicle properties such as numberOfWheels and a move method, and can then add or override its own, such as a bootCapacity attribute. This expresses the relationship "a Car is a Vehicle".
A benefit is code reuse: the shared attributes and methods are written once in Vehicle and inherited by Car and any other vehicle subclass (Lorry, Motorbike), avoiding duplication and making maintenance easier because a change to the shared behaviour is made in one place.
Markers reward correctly describing the subclass deriving from the superclass and a valid benefit (reuse, easier maintenance, clear hierarchy).
AQA 20225 marksExplain what is meant by encapsulation in object-oriented programming and discuss why making attributes private with public methods improves the design of a program.Show worked answer →
Encapsulation is bundling an object's attributes (data) together with the methods that operate on that data inside a single class. It is usually combined with information hiding: the attributes are made private so they cannot be accessed directly from outside, and access is provided only through public methods such as getters and setters.
This improves the design in several ways. It protects the data from invalid changes, because a setter can validate a new value before storing it (rejecting a negative age, for example). It lets the internal representation change without breaking code that uses the class, because callers depend only on the public methods, not on how the data is stored. It also makes the class easier to reason about, since all the code that can alter its data is in one place.
Markers reward defining encapsulation as bundling plus information hiding, and at least two distinct design benefits (validation, hiding implementation, maintainability).
Related dot points
- Understand and use subroutines (procedures and functions), parameters, return values, local and global variables, scope, and the use of an interface and recursion.
A focused answer to AQA A-Level Computer Science 4.1.4 and 4.1.6, covering procedures and functions, parameters and return values, local and global scope, the benefits of subroutines, and recursion.
- Understand the built-in data types: integer, real or float, Boolean, character and string, and understand records, arrays and user-defined data types built from them.
A focused answer to AQA A-Level Computer Science 4.1.1, covering the built-in data types (integer, real, Boolean, character, string), how each is stored, and how records, arrays and user-defined types are built from them.
- Understand and use the three basic programming constructs (sequence, selection and iteration), definite and indefinite iteration, nested constructs, and the meaning of constants and variables.
A focused answer to AQA A-Level Computer Science 4.1.2, covering the three basic constructs sequence, selection and iteration, definite and indefinite iteration, nesting, and the difference between constants and variables.
- Understand the classification of programming languages by level (low and high) and by paradigm (imperative, object-oriented, declarative and functional), and the use of machine code and assembly language.
A focused answer to AQA A-Level Computer Science 4.6.4, covering the classification of programming languages by level (low and high) and by paradigm (imperative, object-oriented, declarative and functional), and the use of machine code and assembly language.
- Understand arrays (one, two and three dimensional), records and fields, and the difference between static and dynamic data structures.
A focused answer to AQA A-Level Computer Science 4.2.1, covering one, two and three dimensional arrays, records and fields, indexing, and the difference between static and dynamic data structures.
Sources & how we know this
- AQA A-level Computer Science (7517) specification — AQA (2015)