-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, registries are created for each scope. Here’s how it works now:
- A container looks in its own registry.
- If nothing is found, it queries the parent.
- This continues until all parents are checked, and only then an error is thrown.
Proposed approach:
- Single shared registry for all scopes.
- The container looks up the factory.
- If the factory is found, we check its scope.
- Traverse the parent chain until we find the matching scope.
This way, we reduce the number of dictionary lookups and simplify the stack traversal logic. It probably can be faster.
In the old approach, we couldn’t distinguish between “not found” and “different scope.” Because of that, we couldn’t implement specialization logic for generic factories or provide meaningful error hints.
In the new approach, we immediately know whether a factory exists but is in the wrong scope.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Ready