Spring Core Tutorial

Introduction

In this Spring Core tutorial, you will learn important concepts of the Spring Framework through detailed explanations and practical examples. This guide covers the basics and fundamentals of the Spring Core, including its Inversion of Control (IoC) container, dependency injection mechanisms, bean scopes, and various annotations. Note that Java 17 is the minimum requirement to work with Spring Framework 6.

YouTube Video - Top 10+ Spring Core Annotations Tutorial

Spring IOC Container

  1. Spring IOC Container Overview - In this article, we discuss what the Spring IOC container is, how it works, how to create a Spring IOC container, and how to retrieve beans from the Spring IOC container with examples.

  2. What is ApplicationContext Interface and Its Implementation Classes - This quick article explains the ApplicationContext interface and its implementation classes with an example.

  3. Spring IOC Container Java Config Example - A simple example demonstrating the working of the Spring IOC Container with Java-based configuration metadata.

  4. Spring IOC Container XML Config Example - A simple example demonstrating the working of the Spring IOC Container with XML-based configuration metadata.

  5. Spring BeanFactory Interface Example - A quick article discussing the Spring BeanFactory interface with an example.

  6. BeanFactory vs ApplicationContext in Spring - This short article quickly discusses the difference between the BeanFactory and ApplicationContext container levels and the implications of bootstrapping.

Spring Dependency Injection

  1. Guide to Dependency Injection in Spring - This guide explains what dependency injection is in the Spring framework and the different types of dependency injection supported in Spring with examples (constructor and setter methods).

  2. Spring Dependency Injection via Setter Example - This article teaches how to use setter-based dependency injection in Spring applications.

  3. Spring Dependency Injection via Constructor Example - This article explains how to use constructor-based dependency injection in Spring applications.

  4. Spring - @DependsOn Annotation Example - This article discusses how to use the @DependsOn annotation in Spring applications with an example.

  5. Spring @Autowired Annotation with Example - This article covers the Spring dependency injection annotation @Autowired with examples.

  6. Spring @Qualifier Annotation Example - This example demonstrates how to use the @Qualifier annotation to resolve ambiguous dependencies.

Spring Bean Scopes

  1. Guide to Spring Bean Scopes - This guide provides an overview of different Spring bean scopes with examples.

  2. Singleton and Prototype Bean Scopes Examples - This article discusses the difference between Singleton and Prototype scope with source code examples.

  3. Spring InitializingBean and DisposableBean Example - This post guides you on how to interact with the container’s management of the bean lifecycle by implementing Spring InitializingBean and DisposableBean interfaces.

  4. Spring @Bean’s init method and destroyMethod Attributes Example - This article discusses how to use the initMethod and destroyMethod attributes of the @Bean annotation to perform actions after bean initialization or before bean destruction by a container.

  5. Spring @Scope annotation with Prototype Scope Example - This article discusses how to create a bean scoped as a prototype using the @Scope annotation.

  6. Spring @Scope annotation with Singleton Scope Example - This article discusses how to create a bean scoped as a singleton using the @Scope annotation.

Annotation-based Configuration

  1. Spring Annotation-Based Container Configuration - This article briefly discusses different annotations that Spring provides to support annotation-based container configuration.

  2. Spring - @Primary Annotation Example - This quick article discusses Spring’s @Primary annotation introduced in version 3.0 of the framework.

  3. Spring @PostConstruct and @PreDestroy Example - This article discusses how to use method-level annotations @PostConstruct and @PreDestroy to customize the nature of a Bean.

  4. Spring @Repository Annotation - This quick article explains how to use the @Repository annotation in Spring-based applications.

  5. Spring @Service Annotation - This quick article discusses how to use the @Service annotation in Spring-based applications.

  6. The Spring @Controller and @RestController Annotations - This article discusses the difference between the @Controller and @RestController annotations in Spring MVC.

Java-based Container Configuration

  1. Spring Java-Based Configuration Basics - This article briefly looks into the basics of Spring Java-based container configuration.

  2. Spring Java-Based Configuration Example - This post demonstrates the usage of Spring Java-based container configuration.

  3. Spring @Bean Annotation with Example - This article discusses Spring Java-based configuration with the @Bean annotation.

  4. Spring @Configuration Annotation with Example - This article discusses the @Configuration annotation with examples.

  5. Spring @PropertySource Annotation with Example - This article explains how to use @PropertySource to read a properties file and display the values with @Value and Environment.

  6. Spring @Import Annotation with Example - This article discusses how to use the Spring @Import annotation with examples.

  7. Spring @ImportResource Annotation Example - This article quickly discusses how to use the @ImportResource annotation with a simple Spring Boot application.

  8. Spring - @Lazy Annotation Example - This quick article discusses the @Lazy annotation with an example.

Miscellaneous

  1. 15 Spring Core Annotations - This quick article discusses Spring Core annotations used in Spring DI and Spring IOC.

GitHub Repository

For the complete source code and additional resources, visit the GitHub repository.

Further Reading

Explore more about the Spring Framework and related technologies with these tutorials:

Comments