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. DI anti-patterns > Constrained Construction

5.3. Constrained Construction

The biggest challenge of properly implementing DI is getting all classes with DEPENDENCIES moved to a COMPOSITION ROOT. When we accomplish this, we’ve already come a long way.

Even so, there are still some traps to look out for. A common mistake is to require all DEPENDENCIES to have a constructor with a particular signature. This normally originates from the desire to attain late binding so that DEPENDENCIES can be defined in an external configuration file and thereby changed without recompiling the application.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint