Tag

dependency injection

What is a Unit Test? Part 1: an introduction

From Unit Testing: Principles, Practices, and Patterns by Vladimir Khorikov

This article covers:

  • Definition of a unit test
  • The differences between shared, private, and volatile dependencies
  • The two schools of unit testing: classical and London
  • The differences between unit, integration, and end-to-end tests

The Transient Lifestyle

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This articles explains the Transient Lifestyle: what it is and when you might want to use it.

The Scoped Lifestyle

From Dependency Injection, Principles, Practices, and Patterns
by Steven van Deursen and Mark Seemann

This articles explains the Scoped Lifestyle: what it is and when you might want to use it.

The Singleton Lifestyle

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This articles explains the Singleton Lifestyle: what it is and what it means for your code.

The Ambient Context Anti-Pattern

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This article explores the Ambient Context DI anti-pattern: what it is, how to identify it, and why it’s so dangerous.

The Service Locator Anti-Pattern

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This articles explains the Service Locator anti-pattern: what it is, what effects it has on code, and why it’s a problem.

Understanding Method Injection

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This article delves into the Method Injection DI Pattern: how it works, and when and why you might want to use it.

Understanding Constructor Injection

From Dependency Injection, Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This article delves into the Constructor Injection DI pattern—what it is and how, when, and why to use it.

Abuse of Abstract Factories

From Dependency Injection Principles, Practices, and Patterns by Steven van Deursen

This article discusses why Abstract Factories shouldn’t be used to create stateful Dependencies with a short lifestyle and why it’s generally better not to use Abstract Factories to select Dependencies based on runtime data.

Understanding the Composition Root

From Dependency Injection Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann

This article describes where and how programmers should compose an application’s object graphs and the concept of the Composition Root.

© 2019 Manning — Design Credits