Dependency Inversion: Depend on the Promise

When the report-card sender builds the school's email server inside itself, it can never send a text and can never be tested without sending real email; the dependency inversion principle says the report card should depend on a promise it owns ("a way to send"), and be handed whatever keeps it, which is the start of dependency injection.

By

Updated

Cheat sheet: Dependency Inversion: Depend on the Promise
Category
Data Structures
Level
Journeyman
Tags
Dependency, Dependency Injection, Dependency Inversion Principle, OOP