Зарегистрироваться
Восстановить пароль
FAQ по входу

Seeman Mark, Steven van Deursen. Dependency Injection: Principles, Practices, Patterns

  • Файл формата pdf
  • размером 24,42 МБ
  • Добавлен пользователем
  • Отредактирован
Seeman Mark, Steven van Deursen. Dependency Injection: Principles, Practices, Patterns
Manning, 2019. — 559 p.
Revised edition of Dependency Edition in .NET
This book debunks the myths around dependency injection (DI) and teaches you good practices and anti-patterns concerning DI while applying this to .NET Core. Our goal is to let this book be as influential as the first edition has been.
Although many tools help us with DI, DI is foremost a set of principles and patterns. Tools are useful, but optional. This message is the common theme throughout this book, since, when you have mastered the patterns and principles behind DI, the correct usage of tools becomes an implementation detail. While tools can make working with DI easier, they won’t compensate for bad design.
The book is divided into four parts.
Part 1 flies through the basics of Dependency Injection. Chapter 1 covers the “what, why, and how” of DI. After that, chapters 2 and 3 walk through building a simple .NET Core web application. We start by showing how easy it is to accidentally write tightly coupled code, after which, in chapter 3, we’ll rewrite the application from scratch, but now using proper DI techniques.
Part 2 focuses on patterns, anti-patterns, and code smells. Chapter 4 dives into the most common patterns Composition Root and Constructor Injection, and the more specialized patterns Method Injection and Property Injection. In chapter 5, we discuss very common anti-patterns, like Service Locator and Ambien Context, while chapter 6 focuses on common code smells and explains how to refactor your code.
Part 3 focuses on the three pillars of DI: Application Composition, Object Lifetime Management, and Interception. We dedicated a chapter to each pillar.
In parts 1 to 3, our discussion is mainly tool agnostic. After part 3, you should be able to design complete loosely coupled applications using pure DI; that is, DI without a tool. In part 4 we dive into the realm of DI Containers and explain how and when you should use these tools, and perhaps even more importantly, when you shouldn’t use them. We discuss two commonly used DI Containers; since this book is about .NET Core, we discuss the DI Container that Microsoft built into ASP.NET Core as well.
We hope you find our book useful to read and hope it will guide you towards more maintainable software that is more fun to write and maintain.
  • Чтобы скачать этот файл зарегистрируйтесь и/или войдите на сайт используя форму сверху.
  • Регистрация