Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 100972

Dependency Injection, is a design pattern where dependencies (instances of objects, properties) of a component are set through the constructor(s), methods or fields (properties). It is a special form of the more general dependency inversion.

3 votes
3 answers
172 views

How do things other than services fit into the Dependency Injection pattern?

Wikipedia explains: A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. But studying Angul …
J.Todd's user avatar
  • 3,823
0 votes
1 answer
72 views

Can a DI object be both a client and a service simultaneously?

In my reasearch of Dependendcy Injection so far I haven't seen an example object being treated as both a client and a service (meaning a service [value, factory, etc] which has its own dependencies). …
J.Todd's user avatar
  • 3,823
0 votes
1 answer
149 views

Does this structure satisfy the terms of the Inversion of Control principle?

I'm trying, as a test, to create Dependency Injection from scratch in JavaScript. Consider the following code structure, which outputs an Alert: Does it satisfy the terms of the Dependency Inversion …
J.Todd's user avatar
  • 3,823
2 votes
2 answers
1k views

What should a Dependency Injector look like in JavaScript?

I'm studying Dependency Injection in JavaScript. I've learned what I need to accomplish, according to Wikipedia, The client delegates to external code (the injector) the responsibility of providing i …
J.Todd's user avatar
  • 3,823
0 votes
4 answers
6k views

How is an interface used in Dependency Injection?

I'm working on a simple DI library, and on the subject of using services through interfaces, I can't find the usefulness. Perhaps it's because I dont fully or properly understand how an interface shou …
J.Todd's user avatar
  • 3,823