Skip to Content
Serverless computing in Azure with .NET
book

Serverless computing in Azure with .NET

by Sasha Rosenbaum
August 2017
Intermediate to advanced
468 pages
12h 5m
English
Packt Publishing
Content preview from Serverless computing in Azure with .NET

Dependency injection

In software engineering, dependency injection is a technique, whereby, one object supplies the dependencies of another object. In dependency injection, a dependency (a service) is passed to the dependent object (a client), so that the service becomes a part of the client state. Dependency injection is one of the forms of the technique called inversion of control. There are multiple types of dependency injection.

It is easiest to illustrate dependency injection with an example. Let us demonstrate the type called constructor injection.

A class without dependency injection may look like the following code snippet:

    public class Client    {     public void SendMessage()     { // instantiate the specific implementation of the service ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni
Implementing Azure: Putting Modern DevOps to Use

Implementing Azure: Putting Modern DevOps to Use

Florian Klaffenbach, Oliver Michalski, Markus Klein, Mohamed Wali

Publisher Resources

ISBN: 9781787288393Supplemental Content