Skip to content

Glossary: Software Design Patterns in C++

Observer

Also written: observer pattern

A pattern where the code where something happens keeps a list of listeners and calls each one, without knowing what they do. Alex's packing slip becomes one new function and one `bus.on` line.

Where the book teaches it

Related terms

ListenerSubjectPublish/subscribeevent bus