When it comes to the Observer pattern, there are a number of related, overlapping terms used by different codebases. Off the top of my head:
- Observer/Observable/Subject
- Listener/Listenable
- Event/Event source/Event sink/Event handler
- Hook/Callback
- Subscriber/Subscribable
- "Firing" vs. "Triggering" vs "Notifying" vs "Executing"
Which of these do consider to be synonymous?
Of terms that are synonymous, which do you prefer to use in your programs?
Of terms that are not synonymous, what semantic differences do the different terms imply to you?
The first thing that springs to mind when I read these is firing an event, triggering a state change or transition in a state machine, notifying a listener, and executing a method.
I've also seen codebases talk in terms of emitting events.
I tend to think an object would 'listen' to events generated (to use a neutral word) by another object, but 'subscribe' to a persistent message queue or topic (where "message" is not the OO kind of message, but the message bus kind of message).