B3.2 Fundamentals of OOP for multiple classesB3.2.5

Commonly Used Design Patterns in OOP

Explain commonly used design patterns in OOP

AHL≈ 60 minCommand term: ExplainPremium

In this lesson

  • Describing what a design pattern is and its three categories
  • Explaining the singleton, factory and observer patterns and the problem each solves
  • Recognising each pattern’s structure in code
  • Choosing a suitable pattern for a scenario and stating its drawbacks

This lesson is part of Premium

Every topic has one free lesson. Premium unlocks every interactive lesson, the exam-style questions at the end of each one, and the rest of Praxis IB.

What's inside

  1. LearnProven solutions to recurring problems
  2. SingletonSingleton: exactly one object
  3. FactoryFactory: one place that creates objects
  4. ObserverObserver: tell everyone who asked
  5. ObserverObserver in code
  6. LearnThe patterns’ structure in UML
  7. LearnSummary of the three patterns
  8. CheckWhich pattern fits?
  9. CheckQuick check
  10. ExamWorked exam answer
  11. ReviewMistakes examiners see
  12. Exam practiceExam-style questions

Ends with 4 exam-style questions worth 14 marks, with a self-marking markscheme.