title: How to deal with constructor changes in dependency injection
body: <p>I am using .net unity dependency injection framework within an application.</p>
  
  <p>This project uses some 'third party libraries' (libraries coded by other teams in same company)</p>
  
  <p>I register some 'Car' classes of my third party library this way:</p>
  
  <pre><code> unityContainer.RegisterType&lt;ICar,Car&gt;();
  </code></pre>
  
  <p>Now, people who develop the 'Car' class decide that it would be better if the constructor took a boolean inside the constructor.</p>
  
  <p>When I get the new version of their library, my code breaks at runtime (I cannot detect the error in the build pipeline):</p>
  
  <p>Resolving parameter \"hasRadio\" of constructor Car
  Resolving System.Boolean,(none)\r\n","exceptionType":"Microsoft.Practices.Unity.ResolutionFailedException"...</p>
  
  <p>So my question is, how would you manage to avoid such issues ?</p>
  
  <p>Is it a matter of best practices to introduce rules such as 'never use primitives in constructors' ?</p>
  
  <p>Is it my test coverage that is not good enough ? For example, should I check that all classes of my unity dependency graph are instantiated with an InjectionConstructor when class constructor contains some primitive ? (I am not even sure one can do it with UnityContainer, whose Registrations field does not give back the InjectionConstructors)</p>
  
  <p>Should I always instantiate classes from third party libraries explicitely (with InjectionFactory), to make sure that build pipeline fails when other team changes constructors without changing my code ? (I am not really happy with this option as it kind'of violates dependency injection principle : /)</p>