Book Image

SPRING COOKBOOK

Book Image

SPRING COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Beans are at the core of Spring. They are standard Java objects instantiated and managed by Spring.

Beans are mostly used to:

  • Configure Spring in some way (database connection parameters, security, and so on)

  • Avoid hardcoding dependencies using dependency injection, so that our classes remain self-contained and unit testable

In this chapter, you'll learn how to define beans and use them.