Is the "Signals and Slots" concept reactive programming?
As w开发者_Go百科ritten in the title - is "Signals and Slots" a simple way of reactive programming?
Signals/Slots is an implementation of the Observer Pattern .
From the wiki on Reactive Programming:
Reactive programming has principal similarities with the Observer pattern commonly used in object-oriented programming. However, integrating the data flow concepts into the programming language would make it easier to express them, and could therefore increase the granularity of the data flow graph. For example, the observer pattern commonly describes data-flows between whole objects/classes, whereas object-oriented reactive programming could target the members of objects/classes.
They use the example of Excel
cells / formulas in the Reactive Programming wiki, which is undoubtedly implemented using the observer pattern under the covers in the excel source code to make it actually happen. However, to the "excel programmer", it's Reactive Programming as they aren't having to implement the Observer Pattern themselves ... so it makes sense on that level. C++/C#/C/etc do not have this ability built in.
精彩评论