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 18. Advanced Types > Dependency Injection

18.11. Dependency Injection

When building a large system out of components, with different implementations for each component, one needs to assemble the component choices. For example, there may be a mock database and a real database, or console logging and file logging. A particular implementation may want the real database and console logging for running an experiment, or the mock database and file logging for running an automated test script.

Usually, there is some dependency among the components. For example, the data access component may require logging.


  

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