Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5. Hitting the database > Learning Spring’s data access philosophy

5.1. Learning Spring’s data access philosophy

From the previous chapters, you know that one of Spring’s goals is to allow you to develop applications following the sound object-oriented (OO) principle of coding to interfaces. Spring’s data access support is no exception.

DAO[1] stands for data access object, which perfectly describes a DAO’s role in an application. DAOs exist to provide a means to read and write data to the database. They should expose this functionality through an interface by which the rest of the application will access them. Figure 5.1 shows the proper approach to designing your data access tier.

[1] Many developers, including Martin Fowler, refer to the persistence objects of an application as repositories. Though I appreciate the thinking that leads to the repository moniker, I believe that the word repository is already overloaded, even without adding this additional meaning. So forgive me, but I’m going to buck the popular trend—I’ll continue referring to these objects as DAOs.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial