❮ Previous Next ❯

IOC Container

IOC is also known as dependency injection (DI). It is a process whereby objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method. The container then injects those dependencies when it creates the bean. This process is fundamentally the inverse, hence the name Inversion of Control (IoC), of the bean itself controlling the instantiation or location of its dependencies by using direct construction of classes.

ioc_cointainer

There are two types of IoC containers. They are:-

  1. BeanFactory.
  2. ApplicationContext.

BeanFactory

The BeanFactory interface is the central IoC container interface in Spring. Its responsibilities include instantiating or sourcing application objects, configuring such objects, and assembling the dependencies between these objects. IOC is the core principle which Spring uses for Separation of concern concept . No matter what you use - Spring MVC, Security , Core , DAO integrations , you will be using the IOC principle.

ApplicationContext

The ApplicationContext interface also acts as the IoC container. The ApplicationContext interface is built on top of the BeanFactory interface. It adds some extra functionality than BeanFactory. So it is better to use ApplicationContext than BeanFactory.


❮ Previous Next ❯

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-N6/530,2ND Floor
Nayapalli,Jayadev Vihar
      Bhubaneswar-751015
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved