~/talk

The Observer Design Pattern in Cpp

Talkat CppCon 2022 · 2022-09-11..09-16· [frontend-architecture]
slides:none on file

Concrete C++ code evolves from a naive single-function handler to interface-based observers to a keyed map of observer lists (example3.cpp uses shared_ptrs) showing notify all vs notify type and the removal case that exposed dangling-pointer hazards, so the pattern decouples sound/physics/logging but costs ownership and performance tradeoffs. References include Angry Birds example, Game Programming Patterns, Java util.Observer, Godot/Qt signals, Blender, Maya, Ogre3D; recommends shared_ptr and weak_ptr and considers templates, concepts, queues or actor models for scale.

AI-written summary · about

  1. 0:00Observer pattern intro
  2. 4:57Why this talk exists
  3. 9:08Behavioral patterns basics
  4. 13:41First implementation
  5. 18:18Problems with first impl
  6. 20:27Interfaces and inheritance
  7. 29:24Type-specific event handling
  8. 38:56Evaluating third impl
  9. 43:33Real-world usage
  10. 51:00Scaling in Angry Birds
  11. 53:27Modernizing the pattern
  12. 1:00:18Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.