Mediator pattern
The Mediator pattern is a behavioral design pattern that centralizes coordination among otherwise interdependent components through an intermediary.
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.
Related concepts
- dependency injectionuses · Dependency injection is a software design technique in which a component receives its dependencies from outside rather than creating or locating them internally.
- design patternkind of · A design pattern is a reusable, general solution structure for a recurring software design problem in a particular context.
- idempotencyuses · Idempotency is the property of an operation whereby repeating it has the same effective result or externally observable effect as performing it once.
- Kubernetesused by · Kubernetes is an open-source platform for orchestrating and automating the deployment, scaling, and management of containerized workloads across computing clusters.
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.

