Java Reference
In-Depth Information
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” in-
cluded 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 re-
view all the ways Groovy can help Spring. Figure 7.1 contains a guide to the technologies
discussed in this chapter.
Search WWH ::




Custom Search