Core CS

Design Patterns & OOP

Object-oriented design from first principles: the four pillars, SOLID, composition vs inheritance, and every Gang-of-Four pattern with the problem it solves, a diagram, and code.

5 modules 24 lessons ~1 h of reading
Start learning
0/24 completed
04

Behavioral

8 lessons
  1. 14StrategyEncapsulating interchangeable algorithms behind a common interface — replacing conditionals, choosing strategies at runtime, strategies as functions, and real-world uses like comparators and pricing rules.beginner2 min
  2. 15ObserverOne-to-many notification when state changes — subjects and observers, push vs pull, event emitters, pub/sub, reactive streams, memory leaks from forgotten subscriptions, and thread-safety concerns.intermediate2 min
  3. 16CommandTurning requests into objects — invokers and receivers, undo/redo stacks, macro commands, job queues, and how commands relate to callbacks and event sourcing.intermediate2 min
  4. 17StateLetting an object change behaviour when its internal state changes — finite state machines, state classes vs transition tables, an order lifecycle example, and when enums suffice.intermediate2 min
  5. 18Template MethodDefining an algorithm's skeleton in a base class and letting subclasses fill in steps — hooks, the Hollywood principle, framework examples, and replacing inheritance with composition.beginner2 min
  6. 19IteratorTraversing a collection without exposing its representation — external vs internal iteration, Java Iterator/Iterable, Python's iterator protocol and generators, JavaScript's Symbol.iterator, lazy and infinite sequences.beginner2 min
  7. 20Chain of ResponsibilityPassing a request along a chain of handlers until one handles it — middleware pipelines, validation chains, approval workflows, and the variant where every handler participates.intermediate2 min
  8. 21Mediator, Memento & VisitorThree remaining GoF behavioural patterns — Mediator centralises communication between components, Memento captures and restores state, and Visitor adds operations to object structures without changing them. Plus brief notes on Interpreter.advanced3 min