The Observer pattern (also known as Publish/Subscribe, or simply pub/sub) is a design pattern that allows us to observe the state of an object and be notified when it changes. The pattern can provide objects with powerful extension points while maintaining loose coupling.
• Design an API using tests.
• Continuously improve design by refactoring—both tests and production code.
• Add functionality one tiny step at a ...