Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Automatically perform verification upon first resolve #555
Many inexperienced users forget to call
Since verification can cause performance problems for big applications, auto-verification should be configurable, for instance:
var container = new Container(); container.Options.EnableAutoVerification = false; // default true container.Register<IFoo, FooImpl>(); container.GetInstance<IFoo>(); // will trigger verification when when EnableAutoVerification = true
This is, however, a major breaking change, because in case the user upgrades to this new version, without setting
#if DEBUG // Prevent verification in release mode. container.Verify(); #endif
I'm tempted to react with thumbs up because verification is something which separates Simple Injector from the rest and is also some kind of ultra climax of all design principles.
However. I think the impact of the breaking change is huge and maybe too huge!
Maybe there is an elegant solution which could be used in two ways. What do you think of including a .ps script in the NuGet package which generates some commented code? This could be both
container.Options.EnableAutoVerification = true;
of course shipped as a more or less complete bootstrapper.cs/bootstrapper.vb
At this time it is probably more interesting to decide which path to take with this, to auto verify or not to auto verify, that's the question :-)