Buy new:
$59.99
FREE delivery Wednesday, August 21
Ships from: Amazon.com
Sold by: Amazon.com
$59.99
FREE Returns
FREE delivery Wednesday, August 21. Order within 14 hrs 2 mins
In Stock
$$59.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$59.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Ships from
Amazon.com
Ships from
Amazon.com
Sold by
Amazon.com
Sold by
Amazon.com
Returns
30-day refund/replacement
30-day refund/replacement
This item can be returned in its original condition for a full refund or replacement within 30 days of receipt.
Returns
30-day refund/replacement
This item can be returned in its original condition for a full refund or replacement within 30 days of receipt.
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
Payment
Secure transaction
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$52.07
FREE Returns
Ships direct from Amazon! Qualifies for Prime Shipping and FREE standard shipping for orders over $35. Ships direct from Amazon! Qualifies for Prime Shipping and FREE standard shipping for orders over $35. See less
FREE delivery Friday, August 23
Only 3 left in stock - order soon.
$$59.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$59.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

Dependency Injection Principles, Practices, and Patterns First Edition

4.7 4.7 out of 5 stars 121 ratings

{"desktop_buybox_group_1":[{"displayPrice":"$59.99","priceAmount":59.99,"currencySymbol":"$","integerValue":"59","decimalSeparator":".","fractionalValue":"99","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"0sWwJW7Qkqf97PIn4jHiKN0Vm%2FoTnY58WF7cfdif9geMMIy8HNGIhtDxhm%2BOYKI1pODgTrnAN8Y9bJOKjjJcqloFTfmM1ZlzCbzz4sSrrwjd%2F5D7gp0Ti3DtiK%2FOp%2FUVW9eMR9q92%2BqIwF7Te%2BAxFA%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$52.07","priceAmount":52.07,"currencySymbol":"$","integerValue":"52","decimalSeparator":".","fractionalValue":"07","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"0sWwJW7Qkqf97PIn4jHiKN0Vm%2FoTnY58Pq5B2yqnMoNRFUmmzDQ2clu4pQ%2BWvdaznsLh8BvnmK4FouU2zRcuJfsEjQb21PlGhEdkgYKVY2TCkacwm65EWhXe1Dn978SW4XZL%2FiYJduJTGXWgj6ydYx%2FU3mtQTs6Uaa0%2BGg1Cd2VDAT5RIe9icg%3D%3D","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

Summary

Dependency Injection Principles, Practices, and Patterns teaches you to use DI to reduce hard-coded dependencies between application components. You'll start by learning what DI is and what types of applications will benefit from it. Then, you'll work through concrete scenarios using C# and the .NET framework to implement DI in your own projects. As you dive into the thoroughly-explained examples, you'll develop a foundation you can apply to any of the many DI libraries for .NET and .NET Core.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

Dependency Injection (DI) is a great way to reduce tight coupling between software components. Instead of hard-coding dependencies, such as specifying a database driver, you make those connections through a third party. Central to application frameworks like ASP.NET Core, DI enables you to better manage changes and other complexity in your software.

About the Book

Dependency Injection Principles, Practices, and Patterns is a revised and expanded edition of the bestselling classic Dependency Injection in .NET. It teaches you DI from the ground up, featuring relevant examples, patterns, and anti-patterns for creating loosely coupled, well-structured applications. The well-annotated code and diagrams use C# examples to illustrate principles that work flawlessly with modern object-oriented languages and DI libraries.

What's Inside

  • Refactoring existing code into loosely coupled code
  • DI techniques that work with statically typed OO languages
  • Integration with common .NET frameworks
  • Updated examples illustrating DI in .NET Core

About the Reader

For intermediate OO developers.

About the Authors

Mark Seemann is a programmer, software architect, and speaker who has been working with software since 1995, including six years with Microsoft. Steven van Deursen is a seasoned .NET developer and architect, and the author and maintainer of the Simple Injector DI library.

Table of Contents

  1. PART 1 Putting Dependency Injection on the map

  2. The basics of Dependency Injection: What, why, and how
  3. Writing tightly coupled code
  4. Writing loosely coupled code
  5. PART 2 Catalog

  6. DI patterns
  7. DI anti-patterns
  8. Code smells
  9. PART 3 Pure DI

  10. Application composition
  11. Object lifetime
  12. Interception
  13. Aspect-Oriented Programming by design
  14. Tool-based Aspect-Oriented Programming
  15. PART 4 DI Containers

  16. DI Container introduction
  17. The Autofac DI Container
  18. The Simple Injector DI Container
  19. The Microsoft.Extensions.DependencyInjection DI Container

Amazon First Reads | Editors' picks at exclusive prices

Frequently bought together

This item: Dependency Injection Principles, Practices, and Patterns
$59.99
Get it as soon as Wednesday, Aug 21
In Stock
Ships from and sold by Amazon.com.
+
$46.99
Get it as soon as Wednesday, Aug 21
In Stock
Ships from and sold by Amazon.com.
+
$32.21
Get it as soon as Wednesday, Aug 21
In Stock
Ships from and sold by Amazon.com.
Total price:
To see our price, add these items to your cart.
Details
Added to Cart
spCSRF_Treatment
Choose items to buy together.

Editorial Reviews

Review

"Actually three books in one: a really good introduction to DI in .NET, an even better one to DI in general, and an absolutely excellent introduction to OO principles and software design."--Mikkel Arentoft, Danske Bank

"This book is a masterpiece. It's amazing and fundamental for every software developer who wants to write solid and correct code."
--Emanuele Origgi, Funambol

"A marvelous, clear, and exhaustive journey into all aspects of DI in .NET, with very focused and complete real world examples."
--Pasquale Zirpoli, MIED Open Source Initiative

About the Author

Mark Seemann is a software architect living in Copenhagen. Previously a developer and architect at Microsoft, Mark is now an independent consultant.

Steven van Deursen is a seasoned .NET developer and architect, and the author and maintainer of the Simple Injector DI library.

Product details

  • Publisher ‏ : ‎ Manning; First Edition (March 16, 2019)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 552 pages
  • ISBN-10 ‏ : ‎ 161729473X
  • ISBN-13 ‏ : ‎ 978-1617294730
  • Item Weight ‏ : ‎ 2.04 pounds
  • Dimensions ‏ : ‎ 7.38 x 1.2 x 9.25 inches
  • Customer Reviews:
    4.7 4.7 out of 5 stars 121 ratings

About the author

Follow authors to get new release updates, plus improved recommendations.
Mark Seemann
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Mark Seemann is a Danish software developer based in Copenhagen, Denmark. His professional interests include functional programming, object-oriented development, as well as software development in general. Apart from writing two books he has also written numerous articles and blog posts about related topics.

Despite being mostly a .NET developer he takes most of his inspiration from sources across a wide range of technologies, including Haskell and lots of pattern books.

Originally poised to become a rock star or (failing that) graphic novelist (in the European tradition) he one day found himself with insufficient talent for either, a masters degree in Economics, and a desire for working with computers. He has been doing the latter intermittently since 1995.

When not working with software or spending time with his family, Mark enjoys reading, listening to and playing music, as well as preparing or consuming gourmet food and wine.

Customer reviews

4.7 out of 5 stars
121 global ratings

Top reviews from the United States

Reviewed in the United States on January 23, 2022
Fast delivery! Book came intact
Reviewed in the United States on March 16, 2019
When the first edition of the book was published, I couldn’t comprehend how a discussion about dependency injection justified 500+ pages. In fact, it wasn’t entirely clear to me why a book was needed at all. Surely, this is a topic that could be covered by a few articles, with any gaps filled in on StackOverflow?

Since then, this has become required reading for my software development staff. There are two realizations that informed this.

The first is that there are a LOT of misunderstandings about dependency injection out there, with quite a few otherwise-reliable sources promoting “best practices” that, ultimately, introduce complexity without necessarily solving the underlying problems. When you go down this rabbit hole, and attempt to make sense of conflicting guidance, two names ultimately emerge from—and stand above—the confusion: Mark Seemann and Steven van Deursen. Consistently, they provide comprehensive, deeply-considered, and rational guidance that not only demonstrates a depth of knowledge, but also establishes a framework, vocabulary, and set of heuristics for thinking through dependency injection challenges. Together, they are the authoritative source on the topic, and this book neatly collates hundreds of articles and StackOverflow responses they’ve made on the topic over the last decade. The book will not only answer your questions, but also address real-world challenges you haven’t yet discovered.

The second is that this isn’t actually a book about dependency injection. It is a design patterns book about writing loosely-coupled and maintainable applications. It is true that it frames this primarily in terms of dependency injection—and, thus, the title of the book. But what the authors recognized is that many of the misunderstandings about dependency injection actually represent more fundamental misunderstandings about software design. As such, instead of simply providing guidance on dependency injection, this book carefully lays out the various approaches people take to solve the underlying problem, how those ultimately fail, and then examines the various design patterns that help address them. In doing so, the book ends up offering a surprisingly practical and approachable exploration of common design patterns.

This is one of those books that will, as you read it, inspire you to refactor your past projects, and immediately change how you approach new code. And not (just) because you’ve leaned a new set of tools or even techniques, but because your knowledge and understanding of fundamental software development practices will have matured. Instead of simply prescribing a set of approaches, this will change how you think about the software design and development.

From this perspective, the second edition is a welcome and impressive update. Yes, it overhauls the technical content to accommodate .NET Core, if that happens to be your framework of choice. More importantly, though, it fully embraces the above perspective, and reorganizes the content around design patterns. The new material on aspect-oriented programming and domain events, in particular, is masterfully presented, and really solidifies (SOLIDifies?) its broader relevance. Further, the guidance regarding what patterns (and tools) to use in which situations has continued to improve, and is both clear-headed and actionable.

Indeed, even if you’ve recently read the first edition of the book, the second edition might well be worth picking up simply for chapters 6, 10, 11, and 12, in particular. (Chapters 10 and 11 are entirely new material; Chapters 6 and 12 have been updated considerably.)

[Disclosure: I was a technical reviewer—an independent, unpaid role—for this edition. I have no commercial interest in the book.]
39 people found this helpful
Report
Reviewed in the United States on September 4, 2019
I thought I knew what dependency injection was until I read this book. The authors broke the concept down to its core and I finally understood the 'why' of DI, not just the 'how'. The authors then built my knowledge up again, first using a 'no-framework' implementation and then using common .Net DI frameworks. I now heartily recommend this book to any software developers who want to go from the doing to the understanding.
10 people found this helpful
Report
Reviewed in the United States on December 24, 2019
DI is quite misunderstood topic, but authors explained them in depth. They explained these concepts without using any frameworks. Chapter 4 provides a good pattern decision process, while chapter 5 and 6 are really helpful for intermediate developers, not only author shows anti-patterns, but also refactoring techniques to overcome them. I personally got a lot of insights from refactoring and various design alternatives.
2 people found this helpful
Report

Top reviews from other countries

Translate all reviews to English
Alireza
5.0 out of 5 stars Fantastic book
Reviewed in Canada on February 3, 2022
This book did a great job explaining various topics that are so important when working with dependency injection like DI anti patterns, Code smells, and some techniques when it comes to manage lifetime of the dependencies. Examples are also very good and helps to understand the concept author tries to explain.
Highly recommend this book.
Cliente Amazon
5.0 out of 5 stars Una de las mejores compras que he hecho sobre libros de diseño y desarrollo
Reviewed in Spain on March 4, 2023
Un libro imprescindible para entender y poner en práctica la inyección de dependencias. Todo lo que se trata aporta siempre algún concepto, visión o práctica interesante... Es estratosférico!!!
Furkan Sakar
5.0 out of 5 stars Good one
Reviewed in Germany on December 14, 2022
Highly recommended if you are using DI in your project.
Raj
5.0 out of 5 stars Wrong vs Right way to design and code explained in detail
Reviewed in India on August 7, 2022
Good example of how to design an application.
Covers much more than DI and guides us on design principles, etc.

Simplest and easy example gives you easy to understand
James Anderson
5.0 out of 5 stars Worth a read
Reviewed in the United Kingdom on June 25, 2021
Really good book with some great info. Even if you already know about DI, the latter half of the book goes into other related subjects which every dev should learn!