-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Description
Current implementation performs basing selection and validation of Injection Members during registration. If injection member could not be matched with an appropriate info, exception is thrown.
Problem
This behavior is implemented for Diagnostic and well as Optimized execution. With Diagnostic mode it is acceptable to waste some time on validating of possible issues. In Optimized mode any overhead is not desirable.
When registering generic types the overhead is even bigger because, regardless of mode, selection is performed twice. Once when selecting generic info, and second time when solid type is resolved.
Solution
In order to solve this issue the selection should be done only once during resolution. Injection members passed to registrations should be validated only in Diagnostic mode and passed as is in Optimized mode.
Impact
Existing code should not be impacted because, supposedly, existing and already working registrations should not throw any exceptions.
New development should no longer expect registrations to throw exceptions in Optimized mode. Only Diagnostic mode will do validation now.