25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 18 ■ <strong>Spring</strong> and Groovy<br />

Listing 18-8. <strong>Spring</strong> DSL and XML Configurations: sampleBeans.groovy<br />

beans {<br />

}<br />

importBeans('classpath:/mydocuments-context.xml')<br />

//More beans<br />

//More beans<br />

Listing 18-7 shows how to use existing XML configurations in the new <strong>Spring</strong> DSL.<br />

Summary<br />

In this chapter, you saw how the <strong>Spring</strong> <strong>Framework</strong> interacts regardless of the main programming language, Java or<br />

Groovy. You can use the new <strong>Spring</strong> DSL, which offers a more readable syntax and is easy to use. You can get rid of all<br />

of the XML verbosity and use a more dynamic way to define your beans.<br />

You saw how to import more beans scripts, either using Groovy or via XML with the importBeans keyword. You<br />

learned the basic syntax of the <strong>Spring</strong> DSL and how to define any bean by translating the XML to the new <strong>Spring</strong> DSL.<br />

In the next chapter, you will create a new <strong>Spring</strong> project, <strong>Spring</strong> Boot. <strong>Spring</strong> Boot simplifies enterprise<br />

development by using Java or Groovy to create micro-services.<br />

262

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!