M
M
Mikhail Makarov2018-11-28 18:18:23
Design patterns
Mikhail Makarov, 2018-11-28 18:18:23

Dependency Injection on fingers?

Explain, please, the principle of implementation of dependence "on fingers". No matter how many articles I read, I don’t get it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
stratosmi, 2018-11-28
@KevlarBeaver

Well, you need to use some kind of functionality. Implemented as a class, function, etc.
If you explicitly call this function, accessing the class is an explicit dependency.
But if you pass this function or class as a variable, this is an injected dependency.
That is, today one function / class was transferred, tomorrow another (if only they were compatible in signature) - your program will not even notice the difference.

S
Sergey Gornostaev, 2018-11-28
@sergey-gornostaev

Architectural questions are complex by definition. To understand them, you need to have a sufficient knowledge base and programming experience. Ideally, in order to understand a pattern, one has to face the problem it was designed to solve. If you already have a knowledge base and experience, but still no understanding, then read a textbook like Martin's Clean Architecture.
And "on the fingers" you will now be given a lot of explanations, most of which will be wrong and confuse even more.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question