Skip to content

Spring Framework Blog

Menu
  • Home
  • Spring
  • Spring Boot
  • About
Menu

Spring Core

Posted on November 20, 2023June 11, 2024 by Armando Marques

The IoC container manages Dependency Injection process and subsequent bean management. Interface BeanFactory provides an advanced configuration.

ApplicationContext is derived from BeanFactory and adds extra functionality:

  • Easier integration with Spring AOP
  • Message Resource handling
  • Event publication
  • Application layer specific context, such as WebApplicationContext.

BeanFactory provides configuration framework and configuration while ApplicationContext add more enterprise-specific functionality.

Spring separates application configuration from application objects (beans) and manages these objects by creating them in a correct dependency order and ensuring that they’re fully initialized.

Key principles:

  • Don’t repeat yourself
  • Separation of concerns
  • Convention over configuration
  • Testability

Application Context

Application Context interface represents the IoC container and is responsible for instantiating, configuring and assemble the beans. The container gets the information how to configure, assemble and instantiate the beans through metadata.

https://docs.spring.io/spring-framework/reference/core/beans/basics.html

There are three ways to configure Application Context:

  • XML , configure beans and resources using xml files.
  • Annotations, annotations configured with autoscan (@Component, @Service, @Repository).
  • Java config – also uses annotations @Bean, @Autowired, @Import and a configuration class.

Spring application context can be created in any environment: standalone applications, web application or Junit tests.

Examples of implementation classes: AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, XmlWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXMLApplication.

ApplicationContext can receive a file or a class as argument.

https://www.baeldung.com/spring-application-context

    • Spring
    • Documentation
    • References
    • Toc
    • Books
    • Certification
    • AOP
    • Config
    • Java
    • Java core
    • JDBC
    • JPA
    • Rest
    • Security
    • Spring
    • Spring Boot
    • Spring Core
    • Spring Data
    • Spring MVC
    • Spring Rest
    • Spring Security
    • Tests
    • Transactions
    • Uncategorized

    Recent Posts

    • Spring Annotations
    • Java Tests
    • Java operators
    • Java versions
    • Java Oracle Licenses
    • Configuration properties
    • MockMvc
    • Spring Security III
    • MVC Controller Method Params
    • JPA Methods
    • Transaction propagation and isolation
    • Spring JDBC
    • Spring Boot Auto-Configuration
    • Spring Resource interface
    • JSR 330 Standard Annotations
    • Spring Aware Interfaces
    • Spring Transactions
    • Spring Boot Core
    • MVC Rest
    • Spring Boot JPA
    ©2025 Spring Framework Blog | Built using WordPress and Responsive Blogily theme by Superb