Nice article,
David López Dayer

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 Analytics class) and the consumers (trackers), especially if we employ the improvement that came up in the other comment with Igor: Analytics doesn’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!! :)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.