Spring Framework

Dependency injection is a design pattern in which a component’s dependencies are supplied externally rather than being hardcoded within the component itself. In Spring, developers mainly use 3 different types of dependency injection: constructor-based, setter-based, and field-based. In this tutorial, we will see how to use Setter-based Dependency Injection to inject a UsersRepository into a…

Read More Setter-based Dependency Injection in Spring

Spring Framework is a popular Java-based framework that provides a comprehensive infrastructure for developing Java applications. The framework was initially released in 2002 by Rod Johnson, who was frustrated with the complexity of the existing Java EE (Enterprise Edition) platform. He wanted to create a simpler and more lightweight framework that would make it easier…

Read More Excel in Spring Framework: The Complete Guide

Multiple data source implementations are very crucial in instances where we want to secure the application from vulnerabilities such as a database failure. This will ensure that the application can still function even if part of the database went down. This tutorial will use student and course entities to demonstrate how multiple data sources can…

Read More Multiple Datasources in Spring Application

This tutorial will teach you how to use constructor-based dependency injection(DI) in Spring Framework when building RESTful Web Services. Read the following tutorial to learn about the different types of dependency injection in Spring and which one may be better suited for your specific use case. Constructor-Based Dependency Injection Overview Constructor-based dependency injection is a…

Read More Spring Constructor-Based Injection