Chapter 7. The Spring framework

 

This chapter covers

  • Using Groovy classes in Spring applications
  • Refreshable beans
  • Inline scripted beans
  • The Grails BeanBuilder class
  • Spring AOP with Groovy classes

As Java frameworks go, Spring is one of the most successful. Spring brought the ideas of dependency injection, complex object lifecycle management, and declarative services for POJOs to the forefront of Java development. It’s a rare project that doesn’t at least consider taking advantage of all Spring has to offer, including the vast array of Spring “beans” included in its library. Spring touches almost every facet of enterprise Java development, in most cases simplifying them dramatically.

In this chapter I’ll look at how Groovy interacts with the Spring framework. As it turns out, Groovy and Spring are old friends. Spring manages Groovy beans as easily as it handles Java. Spring includes special capabilities for working with code from dynamic languages, however, which I’ll review here.

Groovy can be used to implement beans or to configure them. In this chapter I’ll try to review all the ways Groovy can help Spring. Figure 7.1 contains a guide to the technologies discussed in this chapter.

7.1. A Spring application

 
 
 

7.2. Refreshable beans

 
 

7.3. Spring AOP with Groovy beans

 
 

7.4. Inline scripted beans

 
 

7.5. Groovy with JavaConfig

 
 
 

7.6. Building beans with the Grails BeanBuilder

 
 
 

7.7. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage