Loosely coupled design

Let's now return to that idea of loose-coupling. Event producers and event consumers do not directly know about each other—they are said to be loosely coupled. For example, when a participant is added to a business network, existing participants do not need to contact the new joiner to introduce themselves. Instead, the existing participants listen for a new participant event if they are interested. Likewise, if a participant joins a network, it doesn't need to reach out to everyone and everything it is interested in, it just listens for events it thinks are significant—events that might cause it to act. We can see that the event producers and event consumers don't explicitly know about each other—they only know about events—and thus communication can wax and wane very easily—it's much more scalable.

We are now seeing that loose-coupling is a major difference between events and transactions. Transactions explicitly bind participants to each other—in a transaction, we name all the counter-parties. In an event, we have absolutely no idea of how, or even if, the producers and the consumers of the event are related. From a design perspective, it means that we can create a very flexible system. Participants can be coupled to each other in an almost infinitely flexible way via events, and this really does mirror the richness we see in the real world.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.186.202