Mid From PDF SOLID Design Patterns & SOLID

What are anti-patterns related to DI and Singleton?

  • Service Locator anti-pattern: Hides dependencies instead of injecting them

explicitly.

  • Overusing Singleton: Leads to hidden global state and testing difficulties.
  • Improper Singleton thread safety: Causes race conditions.
  • Injecting concrete implementations: Violates DIP.

More from Design Patterns in C#

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details