Dependency Injection Principles, Practices, and Patterns

The book Dependency Injection Principles, Practices, and Patterns has gone to print.

For the last two years I’ve been coauthoring the book Dependency Injection Principles, Practices, and Patterns. This is a revised and expanded edition of Manning’s bestselling classic Dependency Injection in .NET by Mark Seemann.

I always loved the first edition as it was a game changer for me. I learned a lot about DI, DI Containers, and software design. The book even had a big influence on Simple Injector’s philosophy. This influence on Simple Injector even started well before the book was published, as I was a vivid reader of early access version that was first released in October 2009.

For the second edition, Mark decided to join forces with me. This allowed us to combine our ideas and visions, which has led to some interesting directions and new insights. For instance, we changed the status of the Ambient Context pattern to an anti-pattern and explain in much detail why this is an anti-pattern, and we provide better alternatives.

The general theme of this second edition is the focus on the principles, practices, and patterns that underpin Dependency Injection, which is the main reason for the change in the book’s title. There are several areas where you will notice this:

Apart from these changes related to the focus of the book, there are many other changes as well, for instance:

I think that this book has a lot to bring, even to seasoned developers that are familiar with DI, and even for developers working in different OOP languages. The book is first and foremost about DI, but the common thread throughout the book is that of writing well-designed code, as the two concepts are inseparable.

I’m extremely glad I was able to be part of this process and was able to make an awesome book even better.

I would like to thank, Mark, Manning, everybody who provided feedback, and everyone who purchases the Early Access edition.

I hope you will enjoy my work.


Steven - 03 April 19

The book forum on Manning’s website contained a more detailed description of the changes we made in the second edition but, unfortunatelly, Manning pulled the plug on the forum. With it, all posts including that description turned to dust.

Below is a (slightly altered) copy of that description:

What the motivation is for the second edition, and, what’s new?

Our main motivation for writing a the second edition is to share our new knowledge with a broad audience. Although blog posts, presentations, and Pluralsight videos allow us to get this message across, there is no medium as suited to get a complicated story across as a book.

Because writing a new book is a major undertaking, Mark has asked me to help him. It was simply too much to chew off for Mark alone.

What will not change:
What will change:

The second edition focusses even more on patterns & practices than the first edition already did. There are several areas you will notice this:

The book focusses on .NET Core and its frameworks. Although there is still a lot of code that works for any .NET version, especially the parts that show how to integrate (most notably chapter 7), are focused on .NET Core and ASP.NET Core.

We incorporated many of the lessons we learned and knowledge we gained since the first edition was published. This will sometimes manifest itself in small notes or warnings, up to sidebars or even complete sections or chapters.

Wish to comment?

Comments are currently turned off as I switched to a static site generator. I will enable commenting again in the future, most likely using pull requests. Stay tuned...

Buy my book

Dependency Injection Principles, Practices, and Patterns Cover Small I coauthored the book Dependency Injection Principles, Practices, and Patterns. If you're interested to learn more about DI and software design in general, consider reading my book.