Buzz words in Spring Framework

Dependency Inversion:

Higher level modules development should not depend on lower level modules. If they do so, higher level module interfaces will be written on what lower level modules expect. If there is any change in lower level modules, the total dependency may go haywire. 

To solve this dependency, either higher level modules should fix the interfaces where lower level modules can refer (or) by keeping the abstraction(class dependencies) separate from the interfaces so that they can be loosely coupled. 

Inversion of Control:

Inversion of Control(IOC) uses the 2nd approach mentioned above. The job of establishing the dependencies between the classes are abstracted and given it another framework. So that, classes can be more focused on business logic rather than initializing its dependencies. 

Dependency Injection:

Dependency Injection is a way to achieve inversion of control.

It is a design pattern where the application delegates the process of the object creation and dependency resolution of objects to a framework rather than handling itself. It can be done with the help of constructor injection, setter injection, interface injection.

Comments

Post a Comment

Popular posts from this blog

SQL Analytical Functions - Partition by (to split resultset into groups)

Distributed database design using CAP theorem

Easy approach to work with files in Java - Java NIO(New input output)