Inversion of Control(IoC) - short and to the point

I am specially interested in Java Backend Framework -> Spring Boot and also front-end part, eg. Angular or React. Otherwise, fascinated with electronics and IoT.
Search for a command to run...

I am specially interested in Java Backend Framework -> Spring Boot and also front-end part, eg. Angular or React. Otherwise, fascinated with electronics and IoT.
No comments yet. Be the first to comment.
I perfectly remember my first day as a software developer. The start of the student holidays. The melting heat and the realities of COVID-19 in 2021. You could feel the excitement in the air around me. I went to the office and what greeted me was qui...

A few years ago, we have met first time with the commercial use of blockchain and companies which were using this kind of technology to build some new fancy tech products. There were a lot of start-ups like DoxyChain. DoxyChain is a polish start-up...

Recent times are extremely difficult for everyone in the world, specifically for Ukrainian people. Nobody has expected that a crisis like this could happen... I mean the launch of the Russian invasion of Ukraine. When the war in Ukraine started, on ...

This post will be not strictly connected with technology. There will be about my experience with the JHipster framework and also about my latest project. Project explanation Recently, I have been started the project of an app with Spring Boot and Ang...

In this article, we will explain the concept of Dependency Injection(DI) practically and show how to use it in your code with Spring Framework. Introduction Dependency injection is one of the two main functionalities of Spring apart from Inversion of...

In the previous article, I mentioned Inversion of Control in context of Spring Framework basic elements.
In this article, we will understand what exactly IoC is, in practical way.
Inversion of control is a programming principle or a set of rules. Using this rule, inverts the flow of control as compared to traditional flow like in procedural programming.
IoC principle provides flow of control exactly in opposition to standard flow of control used in procedural programming.
Table below, shows two different flows of control.

In the procedural programming, flow of control looks like in the left column. Code written by You, uses libraries to execute coded functions.
General, your code has control over the program. It just uses functions/classes/interfaces which are provided by different libraries.
However, with Inversion of Control principle preserved - the framework takes control over the application and handle stuff like:
"Your code" is only being used by framework to provide specific operations like:
"The best explanation is the shortest one" and this rule I had in my mind while writing this post.
To be honest, I have spent a lot of time reading and watching lots of materials about Inversion of Control, but what you have read in my article is everything that you have to know about this principle. I hope it is helpful!