Select Page

Inversion of Control pattern or dependency injection

You do not create your objects but describe (using cofiguration file) how they should be created and wired together in code. A container (for ex: in case of Spring framework, the IOC container) is then responsible for hooking it all up.

In a typical IOC scenario, the container creates all the objects, wires them together by setting the necessary properties, and determines when methods will be invoked. The three implementation pattern types for IOC are:

Type 1 Services need to implement a dedicated interface through which they are provided with an object from which they can look up dependencies (for example, additional needed services).

Type 2 Dependencies are assigned through #JavaBeans properties (for example, setter methods).

Type 3 Dependencies are provided as constructor parameters and are not exposed as #JavaBeans properties.

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

Categories