Spring 5.x

Home/Tag: Spring 5.x

Spring @PropertySource to read property files

Introduction: The @PropertySource annotation in Spring provides a convenient and declarative mechanism for reading properties files. Properties files contain key-value pairs, e.g. app.log.level = DEBUG. In this article, you will learn to read a value from the property file using @PropertySource and access the specific values using @Value annotation and Environment field. If you are new to Spring, make sure [...]

By |2020-04-06T16:37:33+00:00April 6th, 2020|Categories: Spring Framework|Tags: , , |

IoC Container, Bean Factory vs Application Context in Spring

In this article, you will learn the differences between IoC Container, Application Context and the Bean Factory in Spring Framework. The Spring IoC container is the core of the Spring Framework. It creates the class instances, wires them together, configures them, and manages their complete life cycle from creation till destruction. The Spring container uses dependency injection (DI) to manage [...]

By |2020-04-05T13:17:40+00:00April 5th, 2020|Categories: Spring Framework|Tags: , |

Managed beans using @Component, @Repository, @Service

Introduction: In this tutorial, you will learn the different Spring stereotype annotations (@Component, @Repository and @Service) to declare any class as a Spring-managed Bean. Spring MVC also has several other annotations like @Controller and @RestController. The classes that are managed as beans in Spring are known as Managed Components. There are basically few stereotype annotations in spring that declare classes [...]

By |2020-04-03T18:42:22+00:00April 3rd, 2020|Categories: Java™, Spring Framework|Tags: |

Spring bean Lifecycle Callbacks

In this article, you will learn the Spring bean lifecycle and different ways to run bean initialization callbacks and bean destruction callbacks. Bean lifecycle simply means you want to execute callbacks before the spring bean is available to use and similarly execute callbacks before the bean is destroyed. There are several ways to configure the Spring bean lifecycle callbacks as [...]

By |2020-02-12T08:57:31+00:00January 17th, 2020|Categories: Java™, Spring Framework|Tags: , , |

Inversion of Control and Dependency Injection in Spring

Inversion of Control (IoC) and Dependency Injection (DI) are programming patterns for decoupling the Class dependencies. In this article, we will talk about IoC and DI with respect to Spring Framework. Read High Level introduction of Spring Framework if you are new to Spring. 1. What is Inversion of Control (IoC)? For simplicity, let's say class Vehicle is dependent on [...]

By |2020-02-16T02:12:33+00:00January 16th, 2020|Categories: Java™, Spring Framework|Tags: , , , |

A high-level introduction to Spring Framework

What is the Spring Framework? The age-old answer to this question is, "Spring is a Dependency Injection Framework". In reality, it is much more than that. Spring is the most popular Java Enterprise application development framework, it comes with many tools and libraries to solve almost any problem in the java world. May it be microservices or a simple database-driven [...]

By |2020-04-02T06:34:44+00:00January 4th, 2020|Categories: Java™, Spring Framework|Tags: , |