O'Reilly logo
  • T.L Chan thinks this is interesting:

In this case, lazy initialization is required, but in other cases, the LOCAL DEFAULT could have been assigned in the constructor. Notice that the LOCAL DEFAULT is assigned through the public setter, which ensures that all the Guard Clauses get evaluated.


Cover of Dependency Injection in .NET


Il/i modo/i corretto/i di implementare la property injection. L'opzione di lazy initialization รจ molto interessante per evitare un'istanziazione inutile nel costruttore.