25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2 ■ Working with Classes and Dependencies<br />

Figure 2-4. <strong>Spring</strong> Container/Dependency Injection<br />

Figure 2-4 shows the <strong>Spring</strong> dependency injection container and its life cycle, using a configuration based on bean<br />

definitions. This configuration can be via XML, as you did, or Java configuration annotations, or programmatically.<br />

In the book’s companion source code, you can find the Groovy version of this chapter. You can run it using the<br />

following command:<br />

gradle run –Dtest.single=MyDocumentsGroovyTest test<br />

Summary<br />

In this chapter, you defined your first <strong>Spring</strong> application, called My Documents. This application will evolve over<br />

the course of the entire book so you can experiment and add more features using the <strong>Spring</strong> <strong>Framework</strong> and its<br />

extensions.<br />

You saw the differences using plain Java and you added a <strong>Spring</strong> flavor to it; the <strong>Spring</strong> <strong>Framework</strong> will help you<br />

to have a better object-oriented design, applying its dependency injection implementation.<br />

In the next chapters, you will dive deeper into <strong>Spring</strong> and learn how to enhance your application. You will see how<br />

to use collections, how to add some persistence, and how to expose your application on the web, and much more!<br />

23

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

Saved successfully!

Ooh no, something went wrong!