Abstract
In this chapter, I describe dependency injection (DI), a technique that helps create flexible applications and simplifies unit testing. Dependency injection can be a difficult topic to understand, both in terms of why it can be useful and how it is performed. To that end, I build up slowly, starting with the conventional way of building application components and gradually explaining how dependency injection works and why it matters. Table 18-1 puts dependency injection into context.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2016 Adam Freeman
About this chapter
Cite this chapter
Freeman, A. (2016). Dependency Injection. In: Pro ASP.NET Core MVC . Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0397-2_18
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0397-2_18
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0398-9
Online ISBN: 978-1-4842-0397-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)