Introduction to Spring Tutorial

Posted in Frameworks, Development on January 14, 2007


Introduction to Spring Tutorial
In this tutorial we are going to cover some of the basic features of the Spring framework, such as dependency injection, and demonstrate using MyEclipse to assist you while developing Spring applications. Since Spring is such an expansive set of frameworks, this tutorial will focus on dependency injection, which is one of the core capabilities of Spring that permeates all of Spring. To put it simply, dependency injection is the idea of having a framework manage and assign object references at the moment the reference is needed. This removes the need for the developer to call a property setter or JNDI lookup in order to get a reference to an object when needed. If the system is clearly defined, using XML or annotations for example, then the Spring runtime knows when the dependency is needed and will make sure it is provided appropriately. By removing "object bookkeeping", the developer can more easily focus on the business logic of the application. This simplified view of the Spring core is what we will be looking at in this tutorial. In addition, this tutorial also uses Spring 1.x conventions and doesn't cover some of the new annotations support in Spring 2.0. We will release a tutorial at a future time that will cover the expanded functionality in version 2.0. The program used in this tutorial is the Knight example from the Spring in Action book. The contents of the project were modified slightly to remove any compilation warnings and to help clarify the example, but only in small bits.

Watch Video

Tags: Frameworks, Java, Tutorials, Spring