dependency inversion
nounUK /dɪˈpɛndənsi ɪnˈvɜːʃən/
US /dɪˈpɛndənsi ɪnˈvɜːrʒən/
A way of writing computer code so big parts and small parts don't have to know each other's names.
By using dependency inversion, the app can swap its database without changing the main logic.
OTHER MEANINGS
2. A design rule where high-level code and low-level code both rely on shared abstract ideas.
The team applied dependency inversion so the payment module depended on an interface, not a specific bank API.
3. A technique that lets you replace one part of a program with another more easily.
Dependency inversion made it simple to switch from a test database to a real one.
4. The fifth principle in the SOLID set of object-oriented design guidelines.
Our code review checklist includes dependency inversion to keep modules loosely coupled.