design patterns - Is Inversion of Control specific to OO languages? -


Another way to ask this question is: Do you think the control is inversion?

I ask this question because the Wikipedia article has been abducted by non-o o explanation. It has been taken from and taken since 2007:

I took the liberty to completely rewrite the page, because the previous content was taken entirely by the meaningless "object-oriented" Babbar ...

I do not know that the reversal of the control creates any emotion outside the OO language, already many explanations to give control in procedural languages ​​(event programming is one) Are and Reversal of purely functional languages, such as do not need a concept of control as they work high-order.

In addition to this, where Martin Fowler describes in detail in the IOC that he only handles OO examples.

So, IoC is a particularly o o concept, and what exactly is it?

For me, the IOC tries to turn data into those tasks which are mostly OO languages ​​applicable, and try to pass those functions-of-data as arguments in other functions This is not the only part of the IOC, but there is nothing in it.

There are also factory design patterns, where objects are being constructed and configured.

To IOC, OO concept is especially.

What is your answer?

Look at the theoretical problem with a functional perspective. The first question arises, in the same way Have control which you reverse ?

Then you will realize that this is near an object, method, work or whatever, but what exactly does the code do.

In short, when you do dependency injections, you turn the control of the creation and use of dependencies (resources).

When you give a Windows API function an indicator for the callback function, you give the control to call your function with your parameter.

So you see, IoC is just a theoretical concept and, of course, its various practical implementation.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -