loose coupling
Designing parts of a system so they depend on each other as little as possible and can change independently.
In more detail
Loosely coupled parts talk through small, stable interfaces such as events or messages instead of reaching into each other's internals. That lets one part be replaced or changed without breaking the others.
Examples
In this course: a cart component listens for a cart-add CustomEvent without importing the product card that sends it, and container queries decouple a component's layout from the page.Headless components decouple behaviour from styling, render props decouple logic from markup, and custom hooks decouple stateful logic from any one component.Related terms
- event bus — A shared object that parts of an application use to publish events and subscribe to them, so senders and receivers never reference each other directly.
- CustomEvent — A browser event type you create and name yourself, which carries any data you like in its detail property.
- container query — A CSS rule, written with @container, that styles a component based on the size of its container instead of the whole viewport.
- repository pattern — Putting all the code that reads and writes one kind of data behind a single object, so the rest of the app never talks to the database directly.
- API contract — The written promise an API makes about its operations, inputs, outputs and errors, which callers rely on while the code behind it changes.
- broker — A server that receives messages from producers, stores them and delivers them to consumers, such as RabbitMQ or Apache Kafka.
- encapsulation — Keeping a component's internal data and details behind a small public interface.
- headless component — A component that provides behaviour, state and accessibility but no styling, leaving the look entirely to the consumer.
- custom hook — Your own function whose name starts with use and that calls other hooks, packaging stateful logic so several components can reuse it.
Taught in
- Four Hundred Missing Labels — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Technology Sprint: The Design Review — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Decoupling: SQS, SNS, EventBridge And Step Functions — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Compute Performance: Families, Placement And Lambda Memory — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Performance Clinic: Five Slow Systems, Five Fixes — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Container Queries: Component-Driven Responsive Design — Frontend Architecture & Web Platform
- Passive Listeners, Scroll Performance And Touch Interactions — Frontend Architecture & Web Platform
- CustomEvent Dispatching And Decoupled Component Event Buses — Frontend Architecture & Web Platform
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform
- Unified Build Pipelines: Caching & Dependency Graphs — Production Full-Stack Engineering
- Database Access & Migrations: ORM & Data Layers — Production Full-Stack Engineering
- Health Probes & Graceful Shutdown: Kubernetes Lifecycles — Production Full-Stack Engineering
- Kubernetes Ingress, Routing & TLS Termination — Production Full-Stack Engineering
- Props Contract: Immutability, Children, And Polymorphic Tags — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture
- Higher-Order Components And Render Props: Tradeoff Analysis — React 19 & Modern Component Architecture
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture
- Custom Hook Composition: Encapsulating Reactive Logic — React 19 & Modern Component Architecture
- Accessible Headless Primitives: ARIA, Focus, And Keyboard — React 19 & Modern Component Architecture
References
- MDN: EventTarget
- Azure Architecture Center: Design principles
- Microsoft Learn: Design for evolution (loosely coupled services)