Spring Dependency Injection (DI)

In this tutorial you will learn about Spring Dependency Injection (DI) concept with example. Dependency Injection is a design pattern that allows us to remove dependencies from code so that its easier to maintain and test the code. Lets try to understand why we really need dependency injection. Consider two classes Circle and DrawShape as given below.

In this example DrawShape class is dependent on Circle class because we have used new keyword to create Circle object. In case

Read more

Spring Architecture – Spring Modules

In this tutorial we will take a look on spring architecture and various spring modules. Spring Framework is organized into 20 modules which are arranges in 6 groups as listed below. Core Container Aspect Oriented Programming Instrumentation Web Data Access/Integration Test Lets discuss each of them in brief. Spring Architecture and Spring Modules Image Source Core Container Spring core container is the basis for the complete Spring framework. It provides an implementation for IoC that supports dependency injection. This provides

Read more

Spring Hello World Example

In this tutorial you will learn to create Spring hello world example. I used Spring 4 in this project but the process is same for any other spring version. Before starting the tutorial make sure you have eclipse and jdk on your system. Spring Hello World Example Step 1: Create Java Project Open eclipse ide and create a java project with any name, here I am creating the project with name SpringHelloWorld. You can create the project by going to

Read more