|
|
|
|
|
by acjohnson55
1330 days ago
|
|
For me, this depends on the semantics of the system. Is the sender commanding the receiver to carry out the rest of the process, or is the sender broadcasting information to a dynamic set of interested parties? In other words, are you building a pipeline or a pub-sub? If the former, there is inherently tight coupling between sender and receiver, and the sender should send all necessary context to simplify the system design. If the latter, then we talking about a decoupled system, where the sender cannot make assumptions about what info the receiver does or doesn't need to take further action. A thin event is called for to keep the contract simple. One of my frustrations with the event-driven trend is that people don't always seem to think through what they're designing. It's easy to end up with a much more complex system than a transactional architecture. Generally, I favor modeling as much of my system as possible as pipelines, and use pub-subs sparingly, as places where you have fan out to parallel pipelines. Raw events are like GOTOs. They are extremely powerful, but also very difficult to reason about. |
|