Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No matter which particular DI Container you use, you should always defer the resolution of the application's object graph to the <a href="https://stackoverflow.com/questions/2096978/what-is-the-correct-layer-to-configure-your-ioc-container-when-using-a-service-la/2097108#2097108">last responsible moment</a>. This is called the application's <a href="https://stackoverflow.com/questions/1410719/design-where-should-objects-be-registered-when-using-windsor/1410738#1410738">Composition Root</a>.</p> <p>You can write the bulk of your application <a href="https://stackoverflow.com/questions/2045904/dependency-inject-di-friendly-library/2047657#2047657">without ever referencing the DI Container</a>. This also means that you can defer the decision between configuration in code or config until you need it.</p> <p>You <a href="https://stackoverflow.com/questions/1465849/using-ioc-for-unittesting/1465896#1465896">shouldn't need the container at all for unit testing</a>, but may need it for integration testing. However, in integration tests, you will likely need a different configuration for the container than in the final application.</p> <p>All in all, configuring the container in code is the preferred approach these days because it's more robust and you can apply convention-based configuration mechanics.</p> <p>XML configuration tends to be more brittle and too verbose. In most cases, it simply slows you down because you get no refactoring or compiler support.</p> <p>However, XML configuration is still valid when you need to be able to swap dependencies without recompiling the application. Most DI Containers will let you mix those approaches so that you can have most of your configuration in code, but a few selected dependencies defined in XML for extensibility reasons.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload