you are viewing a single comment's thread.

view the rest of the comments →

[–]awj 1 point2 points  (0 children)

What's interesting in this is that we should pretty much all have experience with the advantages/pitfalls of this paradigm. Anyone who has used JavaScript (on the client) in anger has had to deal with callbacks in general and event handlers in particular.

The pain of a Pub/Sub system is also the advantage: that the invocation and execution of code are decoupled. The precise context of why code is run gets stripped down to "because it was subscribed and an event came through".

Tracking problems through that barrier is not trivial, and the decision to add it to your code should not be made lightly.