liveBook · Manning

Mediator pattern

The Mediator pattern is a behavioral design pattern that centralizes coordination among otherwise interdependent components through an intermediary.

How 2 Manning books explain it

AI-Powered Developer: Build software with ChatGPT and Copilot

The Mediator pattern is a behavioral design pattern that centralizes communication among objects through a mediator to reduce their direct dependencies.

How it is used
Decouples a Kafka adapter from AssetManager while preserving event-driven asset-location updates.
How deep it goes
Explains the pattern through a mediator implementation, constructor wiring, event publication, and handler registration.
Examples
Uses an AssetLocationMediator, AssetLocationUpdated events, AssetManager handlers, and Kafka asset_location messages.
What you can do after
Build it from scratch by introducing a mediator, injecting it into a consumer, and registering domain handlers for published events.

Read how AI-Powered Developer: Build software with ChatGPT and Copilot explains mediator pattern →

Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

A mediator pattern organizes dependencies among infrastructure resources and includes logic to create or delete objects based on their dependencies.

How it is used
Controls infrastructure automation when multiple resources depend on one another.
How deep it goes
Explains dependency ordering, recursive creation, idempotency, and trade-offs, but leaves complete mediator testing to implementation.
Examples
Uses networks, servers, firewall rules, Python factory modules, and an optional load balancer sequence.
What you can do after
Build it from scratch by coordinating resource factories in dependency order and preserving repeatable target-state execution.

Read how Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform explains mediator pattern →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.