Chapter 5. DI anti-patterns

Menu

  • Control Freak
  • Bastard Injection
  • Constrained Construction
  • Service Locator

Gastronomically speaking, Denmark was a developing country in the 1970s—I was there, but I never suffered because I didn’t know any better. The staple was meat and potatoes, but foreign ideas were slowly being integrated—I think part of the reason was that it was also the dawn of the era of mass tourism.

Danes traveled south to other parts of Europe in increasing numbers, and the most adventurous sampled the local food. Back home, pasta became increasingly popular among the younger generation, but no Italian would have recognized the Danish version of bolognese sauce.

Here’s what I imagine happened. Some enterprising Danish tourist liked ...

Get Dependency Injection in .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.