The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

James World (4) [Avatar] Offline
I just wanted to ask the obvious question. I loved the first edition - I'm wondering what the motivation is for the second edition, or in short, what's new? For example, is it getting up to date with newer frameworks or will we see new content on theory? Mark's more recent published blog articles and videos seems to be much more focused on DI alternatives in functional paradigms (although I note he is clear that this in no way invalidates DI when appropriate). It would be interesting to see this angle addressed in the book.
Steven van Deursen (43) [Avatar] Offline
Hi James,

The main motivation for us was to be able to be able 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.
Since writing a new book is a major undertaking, Mark has asked me to help him with this. It was simply too much to chew off for Mark alone.

What will not change:
The second edition will still be solely about implementing DI in statically types object-oriented languages. Examples are still just in C#. Functional Programming has its own patterns and practices and that would deserve a book of its own.
Each chapter will still start with a cooking analogy.

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

* First of all, the discussion of DI Containers is completely moved to Part 4. The first 3 parts of the book will be completely container agnostic.
* More examples are added and many parts are completely re-written throughout the book.
* Ambient Context is now considered an anti-pattern and we describe in detail why that is.
* The original refactoring chapter (6) is almost completely rewritten, and now describes code smells.
* We added new sidebars and new sections where we warn about bad practices and bad design decisions.
* We start referring to the SOLID principles much earlier in the book (in the first edition they were first mentioned in chapter 9).
* We removed some complexity and ambiguity in the book's running code samples. This allows the reader to focus more on applying the patterns and practices.
* The Interception chapter (9) is rewritten for the most part. We added this much information that we decided to split up the chapter in three distinct chapters (9, 10, 11). In chapter 9 we focus on the Decorator pattern as method of interception.
* Chapter 10 contains complete new material discussing how to apply AOP based on the SOLID design principles. In many ways, we consider chapter 10 to be the climax of the book.
* Chapter 11 focusses on applying AOP using tooling such as dynamic interception and compile-time weaving tooling. This information was available in chapter 9 of the first edition, but we elaborated the discussion to explain all the downsides that these approaches have compared to the methods described in chapter 10.
* We now consider compile-time weaving a DI anti-pattern and chapter 11 describes in detail why compile-time weaving is a bad practice when it comes to applying Volatile Dependencies.
* Chapter 12 describes the basics of DI Containers and goes into details how to choose between Pure DI and a DI Container. This chapter is an updated version of chapter 3 of the first edition.
* This edition discusses three DI Containers, which are Autofac, Simple Injector, and Microsoft.Extensions.DependencyInjection. Each container gets its own chapter, and although these chapters are based on the first edition, they also describe how to use those containers in combination with concepts described in this edition, such as the "AOP by design" approach, laid out in chapter 10.
* Chapter 15 describes the Microsoft.Extensions.DependencyInjection container, and discusses in much detail what the limitations and downsides of this simplistic DI Container implementations are, while we do show how to work around some of its limitations.

With the help of Manning’s readability experts, the second edition will now do an even better job to get the message across.

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 after the first edition was published. This will sometimes manifest itself in small notes or warnings, up to sidebars or even complete sections or chapters.

Note the following obvious warning: This book hasn’t been released yet, so keep in mind that everything written above could still change.
James World (4) [Avatar] Offline
If your book is as comprehensive and well written as this clarification, it should be good!

Thank you for the speedy response and I look forward to enjoying the finished work.