aımnova
DashboardMy LearningCrash CoursesStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Crash Courses
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Teachers
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aımnova

IB study, practice and feedback built around the real exam.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.c1e448f

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 7.2Design patterns
Back to Computer Science HL Topics
7.2.54 min read

Design patterns (Computer Science HL)

IB Computer Science · Unit 7

AI-powered feedback

Stop guessing — know where you lost marks

Get instant, examiner-style feedback on every answer. See exactly how to improve and what the markscheme expects.

Try It Free

Contents

  1. 1Named solutions to problems that recur
  2. 2The patterns to know
  3. 3Choosing well — and not over-using
  4. 4Exam-style question
The big idea: A design pattern is a named, reusable solution to a problem that keeps coming up — not a library, and not code you copy.

Its real value is vocabulary: "use an observer here" replaces a paragraph of explanation.

What a pattern is and is not

  • Is a description of a structure and why it works
  • Is shared vocabulary between developers
  • Is not a library or a framework — you implement it yourself
  • Is not obligatory: forcing a pattern where there is no problem adds complexity for nothing

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime
1

Singleton

Guarantees a class has exactly one instance, with a global point of access.

Used for a configuration store or a connection pool. Widely criticised: it is global state, which makes testing hard and hides dependencies.

2

Factory

A method decides which subclass to create, so callers ask for what they want rather than naming a concrete class.

Adding a new kind changes the factory only — not every place that creates one.

3

Observer

Objects subscribe to a subject and are notified when it changes.

The subject knows only that observers exist, not who they are — so new observers need no change to it. Every event system works this way.

4

Strategy

Interchangeable algorithms behind one interface, selected at run time.

A sort that can be given different comparison rules, or a route planner switching between fastest and shortest.

Each one removes a specific pain: Factory removes scattered constructor calls. Observer removes the subject having to know its listeners. Strategy removes an if-chain choosing an algorithm. Singleton removes duplicate instances — at the cost of introducing global state.

Name the pain, and the pattern justifies itself.

Stop wasting time on topics you know

Our AI identifies your weak areas and focuses your study time where it matters. No more overstudying easy topics.

Try Smart Study FreeYour first topic is free to keep • No credit card required
ProblemPatternWhat it removes
One instance must be sharedSingletonDuplicate, inconsistent instances
Which class to create variesFactoryConcrete class names scattered everywhere
Many parts react to a changeObserverThe subject knowing its listeners
The algorithm must varyStrategyAn if-chain selecting behaviour
Over-application is a real fault: A pattern applied where its problem does not exist adds indirection, files and vocabulary for no benefit.

A factory producing one kind of object is just a constructor with extra steps. In an exam, saying when not to use a pattern shows judgement.

How this is tested — you must match a pattern to the problem it solves and say what it removes. It comes up two ways:

Paper 2 — working with code

  • Explain a named pattern, 3-4 marks
  • State the purpose of singleton, factory or observer
  • Identify which pattern a description matches

Paper 2 — the algorithmic-thinking question

  • Choose a pattern for a scenario and justify it
  • Explain a drawback of a pattern
The classic trap: Describing what the pattern is without saying what it removes. "An observer notifies subscribers" is a definition; "so the subject never has to know who is listening, and new listeners need no change to it" is the answer.

The problem Observer answers, and the shape it uses.

Interactive diagram

Explore the labelled diagram, charts and maps for this topic in full study mode.

Claim your free topic
IB-style questionSuggest[5 marks]

A dashboard shows a temperature reading as a number, a graph and a warning light, all updating when a new reading arrives. Suggest a design pattern, justify it, and state one drawback.

Model answer plan

See the answer broken into clear points, with guidance on how each point earns marks.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Design patterns. Write your answer and get instant AI feedback — just like a real IB examiner.

A program writes all its error messages to one log file. why the singleton pattern suits the logger. [2 marks]

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

7.1.1Fundamentals of OOP7.1.2Designing classes7.1.3Static vs non-static7.1.4Classes and objects
View all Computer Science HL topics
Improve your exam techniqueCommand terms, paper structure, and mark-scheme tips for Computer Science HL
Previous7.2.4Composition and aggregationNextWhat ADTs are for8.1.1

3 exam-style questions ready for you

Students who practice on Aimnova improve their scores by 15% on average. Get instant feedback that shows exactly how to improve your answers.

Practice Now — FreeView All Computer Science HL Topics