Thanks for your comment.
I guess you are right in that the “traditional” method doesn’t necessarily violate any of the SOLID principles. But I consider the reactive approach to be superior in various ways that are in line with the “spirit” of SOLID:
- enhanced readability, as you say
- more flexibility
- and looser coupling between the producer of events ( the
Analyticsclass) and the consumers (trackers), especially if we employ the improvement that came up in the other comment with Igor:
Analyticsdoesn’t know anything about the trackers, and the trackers don’t know anything about
Analytics, they just receive the events.
And of course Rx is more cool!! :)