4. Understanding the Dependency Inversion Principle

In this chapter, we discuss the cornerstone of the architecture we work with throughout this book—The Dependency Inversion Principle (also known as Inversion of Control, or IoC). Applying this principle is the first step toward breaking the tight coupling of the application and making it easier to enhance and test.

The goal of Dependency Inversion is to break the tight coupling in software that causes code to be rigid and fragile. Before we talk about how the Dependency Inversion Principle helps us remove the tight coupling from the application, let’s discuss what tight coupling is and why it makes an application fragile.

Understanding Tight Coupling

Classes in applications can be split into ...

Get Reengineering .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.