Skip to main content
Fixed dead link [2]. Updated link [3]. Fixed a typo.
Source Link

In my book, I provide the distinction between Stable and Volatile DependenciesVolatile Dependencies. It's most important to use DI with Volatile Dependencies, but often you can achieve even looser coupling by also abstracting and injecting Stable Dependencies.

Keep in mind that the application of DI should not rely on a DI Container. In the case where Poor Man's DI is in use, no new keywords are removed - they are just moved to the Composition RootComposition Root.

Some people actually prefer Poor Man's DI over DI Containers. The maintenance cost may be higher, but you get compile-time safety in return. As I recently heard Dan North say: "new is the new new" :)

What is meant by this is simply thanthat instead of implementing the Composition Root with a DI Container, it'd just contain a whole bunch of nested new statements.

In my book, I provide the distinction between Stable and Volatile Dependencies. It's most important to use DI with Volatile Dependencies, but often you can achieve even looser coupling by also abstracting and injecting Stable Dependencies.

Keep in mind that the application of DI should not rely on a DI Container. In the case where Poor Man's DI is in use, no new keywords are removed - they are just moved to the Composition Root.

Some people actually prefer Poor Man's DI over DI Containers. The maintenance cost may be higher, but you get compile-time safety in return. As I recently heard Dan North say: "new is the new new" :)

What is meant by this is simply than instead of implementing the Composition Root with a DI Container, it'd just contain a whole bunch of nested new statements.

In my book, I provide the distinction between Stable and Volatile Dependencies. It's most important to use DI with Volatile Dependencies, but often you can achieve even looser coupling by also abstracting and injecting Stable Dependencies.

Keep in mind that the application of DI should not rely on a DI Container. In the case where Poor Man's DI is in use, no new keywords are removed - they are just moved to the Composition Root.

Some people actually prefer Poor Man's DI over DI Containers. The maintenance cost may be higher, but you get compile-time safety in return. As I recently heard Dan North say: "new is the new new" :)

What is meant by this is simply that instead of implementing the Composition Root with a DI Container, it'd just contain a whole bunch of nested new statements.

Source Link
Mark Seemann
  • 3.9k
  • 26
  • 30

In my book, I provide the distinction between Stable and Volatile Dependencies. It's most important to use DI with Volatile Dependencies, but often you can achieve even looser coupling by also abstracting and injecting Stable Dependencies.

Keep in mind that the application of DI should not rely on a DI Container. In the case where Poor Man's DI is in use, no new keywords are removed - they are just moved to the Composition Root.

Some people actually prefer Poor Man's DI over DI Containers. The maintenance cost may be higher, but you get compile-time safety in return. As I recently heard Dan North say: "new is the new new" :)

What is meant by this is simply than instead of implementing the Composition Root with a DI Container, it'd just contain a whole bunch of nested new statements.