B3.2 Fundamentals of OOP for multiple classes (HL) - IB Diploma Class 12 Computer Science Notes, Diagrams and Solved Questions

Higher level OOP with several classes in Python and Java: inheritance and super, polymorphism through overriding, overloading and dynamic dispatch, abstract classes and interfaces, composition and aggregation, UML relationships, and the singleton, factory and observer patterns.

In this chapter

  • Inheritance with superclasses, subclasses, extends and super
  • Polymorphism: overriding and dynamic dispatch
  • Overloading in Java and default parameters in Python
  • Abstract classes, abstract methods and interfaces
  • Composition and aggregation (has-a) vs inheritance (is-a)
  • UML class diagrams with inheritance, realisation, composition and aggregation
  • Singleton, factory and observer design patterns
  • Iteration 3: constructor chaining, overrides that reuse super, multi-class design