From b63a59aff82d5eb5be87ffe507814887deaea4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Wed, 27 Dec 2023 09:53:44 +0100 Subject: [PATCH 1/3] Create topic "dependency injection" --- topics/dependency-injection/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 topics/dependency-injection/index.md diff --git a/topics/dependency-injection/index.md b/topics/dependency-injection/index.md new file mode 100644 index 00000000000..273fd18ccf2 --- /dev/null +++ b/topics/dependency-injection/index.md @@ -0,0 +1,13 @@ +--- +topic: dependency-injection +display_name: Dependency injection +short_description: Dependency injection separates the depndency's implementation from the class that's using it by passing it in from outside. +related: separation-of-concerns, loose-coupling, dependency-inversion-principle, inversion-of-control, constructor-injection, service-locator-pattern +wikipedia_url: https://en.wikipedia.org/wiki/Dependency_injection +--- +**Dependency injection** (**DI**) is an implementation of the [dependency inversion principle](/topics/dependency-inversion-principle) with the aim of [separation of concerns](/topics/separation-of-concerns) by separating the depndency's implementation from the class that's using it. That kind of abstraction makes it possible to have different implementations with the same public methods so the class using it, doesn't need to care which of the implementations is used. This is also especially useful for [unit testing](/topics/unit-testing). + +There are different types of dependency injection: +* [constructor injection](/topics/constructor-injection) +* [setter injection](/topics/setter-injection) +* [interface injection](/topics/interface-injection) From 4935bdabf7734cb5a5c0779d3cff8df2cad1abd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Wed, 27 Dec 2023 09:58:17 +0100 Subject: [PATCH 2/3] Add alias, url, created_by, released and a related topic --- topics/dependency-injection/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/topics/dependency-injection/index.md b/topics/dependency-injection/index.md index 273fd18ccf2..3d2992ac077 100644 --- a/topics/dependency-injection/index.md +++ b/topics/dependency-injection/index.md @@ -1,9 +1,13 @@ --- +aliases: dependency-injection-pattern topic: dependency-injection display_name: Dependency injection short_description: Dependency injection separates the depndency's implementation from the class that's using it by passing it in from outside. -related: separation-of-concerns, loose-coupling, dependency-inversion-principle, inversion-of-control, constructor-injection, service-locator-pattern +related: separation-of-concerns, loose-coupling, dependency-inversion-principle, inversion-of-control, constructor-injection, service-locator-pattern, dependency-injection-container wikipedia_url: https://en.wikipedia.org/wiki/Dependency_injection +url: https://martinfowler.com/articles/injection.html +created_by: Martin Fowler +released: 23 January, 2004 --- **Dependency injection** (**DI**) is an implementation of the [dependency inversion principle](/topics/dependency-inversion-principle) with the aim of [separation of concerns](/topics/separation-of-concerns) by separating the depndency's implementation from the class that's using it. That kind of abstraction makes it possible to have different implementations with the same public methods so the class using it, doesn't need to care which of the implementations is used. This is also especially useful for [unit testing](/topics/unit-testing). From 6511aa989d142b4b72890481fc28643be38210bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:17:15 +0100 Subject: [PATCH 3/3] Correct date format --- topics/dependency-injection/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topics/dependency-injection/index.md b/topics/dependency-injection/index.md index 3d2992ac077..9e964d90c48 100644 --- a/topics/dependency-injection/index.md +++ b/topics/dependency-injection/index.md @@ -7,7 +7,7 @@ related: separation-of-concerns, loose-coupling, dependency-inversion-principle, wikipedia_url: https://en.wikipedia.org/wiki/Dependency_injection url: https://martinfowler.com/articles/injection.html created_by: Martin Fowler -released: 23 January, 2004 +released: January 23, 2004 --- **Dependency injection** (**DI**) is an implementation of the [dependency inversion principle](/topics/dependency-inversion-principle) with the aim of [separation of concerns](/topics/separation-of-concerns) by separating the depndency's implementation from the class that's using it. That kind of abstraction makes it possible to have different implementations with the same public methods so the class using it, doesn't need to care which of the implementations is used. This is also especially useful for [unit testing](/topics/unit-testing).