You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overriding a type for testing is a very useful feature. A possible way to allow for this is supporting qualifiers for types which act at registration time. They could work in a similar fashion as the meta annotation @Qualifier. Options are a meta annotation @Profile or @ProfileQualifier.
A profile qualifier could then be created similar to Spring as follows:
An external strategy should be able to determine if a type is allowed to be registered. The external strategy could be configured with the active profiles, and then given an AnnotatedElement determine if a given type is allowed to be registered or not:
The injector calls this for each type about to be registered and rejects registration if the method returns false. How to reject the registration is still unclear:
Silently skip registration
Throw an exception
Throw an exception only for explicitly registered types (not auto discovered ones)
Externalizing the profile determination allows to create customized implementations of profiles without changes to the core system.
The text was updated successfully, but these errors were encountered:
Overriding a type for testing is a very useful feature. A possible way to allow for this is supporting qualifiers for types which act at registration time. They could work in a similar fashion as the meta annotation
@Qualifier
. Options are a meta annotation@Profile
or@ProfileQualifier
.A profile qualifier could then be created similar to Spring as follows:
Possible Implementation
An external strategy should be able to determine if a type is allowed to be registered. The external strategy could be configured with the active profiles, and then given an
AnnotatedElement
determine if a given type is allowed to be registered or not:The injector calls this for each type about to be registered and rejects registration if the method returns
false
. How to reject the registration is still unclear:Externalizing the profile determination allows to create customized implementations of profiles without changes to the core system.
The text was updated successfully, but these errors were encountered: