Dependency inversion
Dependency inversion is a design principle in which high-level policy and low-level implementation depend on abstractions rather than directly on each other.
.NET MAUI in Action
Dependency inversion is a design principle in which higher-level code depends on abstractions rather than concrete implementation details.
- How it is used
- Defines View and ViewModel requirements as interfaces before services provide their implementations.
- How deep it goes
- Explains consumer-defined, focused interfaces and constructor injection, while deferring deeper SOLID treatment.
- Examples
- Uses login authentication, a Sum dependency, inventory services, and swapping a REST API for GraphQL.
- What you can do after
- Apply it via constructor injection and ServiceCollection to replace service implementations without changing consumers.
Read how .NET MAUI in Action explains dependency inversion →
Functional Design and Architecture: Examples in Haskell
The dependency inversion principle is a design principle requiring high-level policy to depend on abstractions rather than directly on low-level implementation details.
- How it is used
- Separates business logic from external subsystems so implementations can be selected and injected at application boundaries.
- How deep it goes
- Explains interfaces, injection, layered separation, and several FP approaches, while deferring their detailed implementations.
- Examples
- Uses greeting handles with alternate implementations and an astronomer application reporting meteors through a hidden channel.
- What you can do after
- Apply it via functional interfaces and injected implementations to decouple IO-bound business logic and substitute dependencies in tests.
Read how Functional Design and Architecture: Examples in Haskell explains dependency inversion →
AI-Powered Developer: Build software with ChatGPT and Copilot
A software-design principle stating that high-level policy should not depend directly on low-level details and that both should depend on abstractions.
- How it is used
- Guides flexible architecture documentation by separating high-level behavior from low-level implementation details.
- How deep it goes
- Defines DIP briefly and illustrates it with an interface plus four concrete depreciation implementations.
- Examples
- Uses an IT asset model where FundingDetails selects among four DepreciationStrategy implementations.
- What you can do after
- Evaluate/understand designs that replace direct implementation dependencies with interface-based collaborators.
ASP.NET Core in Action, 3e
The dependency inversion principle is a design principle in which high-level modules depend on abstractions rather than low-level implementation details.
- How it is used
- Uses dependency inversion to keep application code independent from low-level service construction as complexity grows.
- How deep it goes
- Defines the principle, distinguishes it from dependency injection, and demonstrates container-provided services without exploring container internals.
- Examples
- Demonstrates user registration, EmailSender, MessageFactory, NetworkClient, and email server settings.
- What you can do after
- Apply it via ASP.NET Core dependency injection by declaring required services instead of constructing their dependency graph manually.
Read how ASP.NET Core in Action, 3e explains dependency inversion →
.NET in Action, Second Edition
The dependency inversion principle is a software design principle in which high-level modules depend on abstractions rather than concrete low-level implementations.
- How it is used
- Uses abstractions to make production components replaceable and unit tests controllable.
- How deep it goes
- Explains interface substitution, constructor injection, default implementations, and deterministic fakes through C# examples.
- Examples
- Demonstrates card shuffling with randomization interfaces and stopwatch timing with an injectable system clock.
- What you can do after
- Build it from scratch with interfaces and constructor injection, then test behavior using deterministic implementations.
Read how .NET in Action, Second Edition explains dependency inversion →
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
A software design principle stating that high-level components should depend on abstractions rather than low-level implementation details.
- How it is used
- Protects high-level infrastructure resources from low-level module changes and reduces deployment disruption.
- How deep it goes
- Defines the principle, compares three abstraction forms, and demonstrates attribute interpolation, while deferring full implementations of other forms.
- Examples
- Uses network, subnet, and server modules, with Python attribute interpolation and module or state-based metadata access.
- What you can do after
- Apply it by inserting abstractions between infrastructure resources and selecting attributes, outputs, or state for metadata exchange.
Related concepts
- dependency injectionused by · Dependency injection is a software design technique in which a component receives its dependencies from outside rather than creating or locating them internally.
- abstractionuses · Abstraction is a simplified representation that exposes relevant properties or behavior while omitting lower-level details unnecessary for a given purpose.
- couplingaddresses · Coupling is the degree of dependency between software components, including how their behavior, availability, or changes affect one another.
- ASP.NET Coreimplemented by · ASP.NET Core is Microsoft’s cross-platform, open-source framework for building web applications and services on the .NET platform.
- requestscontrasts with · Requests is a Python library that provides a high-level interface for sending HTTP requests and handling responses.
- interfaceuses · A software interface is a contract or boundary that specifies the operations, properties, or capabilities through which types or components interact, without requiring a particular implementation.
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.





