IB Computer Science HL · Year 2 · Lesson 17

Polymorphism

Multiple-class OOP adds relationships and flexible behaviour through inheritance, polymorphism, abstraction, composition and patterns.

Paper 250 minutesB3.2.2
Today’s targets

What you need to be able to do

2 / 8
  • ConstructCode to model polymorphism and its various forms, such as method overriding
B3.2.2
Paper 2 lensMatch the depth of every response to the command term. Previously learned content can move quickly, but retrieval must still be accurate.
Retrieve

Rapid Recall Deck

3 / 8

Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.

  • What is polymorphism?: The ability to use a common interface or reference while different objects provide different behaviour.
  • What is method overriding?: A child class provides its own implementation of a method already defined by a parent class.
  • What is dynamic polymorphism?: The specific overridden method is chosen at runtime based on the actual object involved.
  • What is static polymorphism?: The operation is selected before runtime, commonly through compile-time mechanisms such as method overloading where the language supports it.
  • Why does polymorphism improve flexibility?: Code can work with a general type or interface while new specialized behaviours can be added without rewriting the calling code.
B3.2.2 · Learn

Core knowledge and application

4 / 8
B3.2.2Construct

Code to model polymorphism and its various forms, such as method overriding

Multiple-class OOP adds relationships and flexible behaviour through inheritance, polymorphism, abstraction, composition and patterns.

Exam moveProduce the required code, diagram, query, model or representation accurately.
Required detail 1The principle of polymorphism and how it contributes to code flexibility and reusability
Required detail 2How to implement dynamic polymorphic behaviour through mechanisms like method overriding
Required detail 3How to apply static polymorphic behaviour to maximize code efficiency
Assessment boundaryPaper 2

Explain it without notes

Construct: Code to model polymorphism and its various forms, such as method overriding in the context of a school platform with multiple interacting object types.

  • The principle of polymorphism and how it contributes to code flexibility and reusability
  • How to implement dynamic polymorphic behaviour through mechanisms like method overriding
  • How to apply static polymorphic behaviour to maximize code efficiency
Trace / construct

Programming checkpoint

5 / 8
class Shape:
    def area(self):
        raise NotImplementedError
class Square(Shape):
    def __init__(self, side): self.side = side
    def area(self): return self.side * self.side
Before you run itTrace the code by hand. Identify state changes, branch/loop behaviour, and the final result.

Modify it

Change one condition, input or operation so the program solves a slightly different problem. Predict the effect before editing.

Apply

Transfer to a new scenario

6 / 8
ScenarioA school platform with multiple interacting object types needs a design or technical decision related to today’s topic. Explain what matters and why.
  • The principle of polymorphism and how it contributes to code flexibility and reusability
  • How to implement dynamic polymorphic behaviour through mechanisms like method overriding
Exam lens

Paper 2 practice

7 / 8
Build the response before checking notesUse precise terminology and match the required depth.
  1. Construct: Code to model polymorphism and its various forms, such as method overriding in the context of a school platform with multiple interacting object types.
Self-checkAnswer the exact command term. For explain, include mechanism/reason; for compare, pair criteria; for discuss/evaluate/justify, build supported reasoning and a conclusion.
Homework

Finish the learning cycle

8 / 8

IA — main task

Continue Criterion D development. Keep code readable, record meaningful implementation decisions, and maintain testing/evidence notes as you work.

Syllabus — short

Complete one targeted Paper 2/Paper 1 retrieval task from today’s lesson.