1.

Elaborate ApplicationContext and it’s role in Spring Boot?

Answer»

ApplicationContext is an interface that extends BeanFactory. In addition to providing Dependency Injection, it also provides services like Aspect ORIENTED Programming (AOP), internationalization (i18n), EVENT HANDLING, etc. It is also referred to as the advanced container used by Spring for storing all the environmental information with regard to an APPLICATION being managed by Spring. It is read-only at run time but can be reloaded if necessary.

Spring recommends using ApplicationContext in all the scenarios, except when it is critical to the additional few KBs of memory that ApplicationContext consumes.

ApplicationContext provides the following abilities:

  • Bean factory METHODS for accessing application components.
  • To load file resources in a generic fashion.
  • To publish events to registered listeners.
  • To resolve messages to support internationalization.


Discussion

No Comment Found