2 ms·
Observer pattern. Say you have some event that occurs, and some objects that want to know about it. You make a signal and connect some observers to it. When you
by lordnacho 11y ago
Observer pattern. Say you have some event that occurs, and some objects that want to know about it. You make a signal and connect some observers to it. When you fire the signal the observers receive some parameters and do their calculations.
- ajuc 11y agoWhy it's interesting alternative: regular observer pattern make observed code depend (at compile time) on the observing code. Signals/slots remove this dependency, and allow for external configuration of these. It's a dependency injection mechanism when you think about it.