Chapter 1. Springing into action
Listing 1.1. EJB 2.1 forced you to implement methods that weren’t needed.
Listing 1.2. Spring doesn’t make any unreasonable demands on HelloWorldBean.
Listing 1.3. A DamselRescuingKnight can only embark on RescueDamselQuests.
Listing 1.4. A BraveKnight is flexible enough to take on any Quest he’s given
Listing 1.5. To test BraveKnight, you’ll inject it with a mock Quest.
Listing 1.6. Injecting a SlayDragonQuest into a BraveKnight with Spring
Listing 1.7. KnightMain.java loads the Spring context containing a knight.
Listing 1.8. A Minstrel is a musically inclined logging system of medieval times
Listing 1.9. A BraveKnight that must call Minstrel methods
Listing 1.10. Declaring the Minstrel as an aspect
Listing 1.11. Many Java APIs, such as JDBC, involve writing a lot of boilerplate code.
Listing 1.12. Templates let your code focus on the task at hand.
Chapter 2. Wiring beans
Listing 2.1. A juggling bean
Listing 2.2. A juggler who waxes poetic
Listing 2.3. A class that represents a great work of the Bard
Listing 2.4. The Stage singleton class
Listing 2.5. Defining a performer who is talented with musical instruments
Listing 2.6. A saxophone implementation of Instrument
Listing 2.7. A piano implementation of Instrument
Listing 2.8. A performer that’s a one-man-band
Listing 2.9. Changing OneManBand’s instrument collection to a Map
Listing 2.10. A list of cities, defined using Spring’s <util:list> element
Chapter 3. Minimizing XML configuration in Spring