DEV Community

Discussion on: Inversion of Inversion of Control

Collapse
 
jwp profile image
John Peters • Edited

The first Foo method is not in control of when the fetch returns, is not blocking during the fetch, but does not progress to next step until the system performs the await. I'm thinking it is IoC because the system does indeed resume control on to original stack in same way as a event would. I never think of this pattern as IoC rather I call it the async/await pattern.

For me, IoC is using Dependency Injection, Interfaces, and even functions, the idea being the caller is able to drive the behaviors.

Collapse
 
3shain profile image
3Shain

……I don't know if you did get my idea…The "control" I'm talking about has nothing to do with thread/blocking/stack, but a mental interpretion of logic flows.

Collapse
 
jwp profile image
John Peters

No I understand just don't think it's a good article on IoC, too many problems.

Thread Thread
 
3shain profile image
3Shain • Edited

Yeah someday I will find out what's not so correct. I do have some similar experiences for several times, due to have different (levels of) perspectives to a problem.

Issues so far: poor English; ill-demostrated example;

Thread Thread
 
jwp profile image
John Peters

But the good news is this post may be improved. The topic is good for sure.