Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement IAddPolicies interface #28

Open
ENikS opened this issue Sep 19, 2018 · 0 comments
Open

Implement IAddPolicies interface #28

ENikS opened this issue Sep 19, 2018 · 0 comments
Assignees

Comments

@ENikS
Copy link
Contributor

ENikS commented Sep 19, 2018

Description

InjectionMember class implements AddPolicies methods called during registration. Default implementation does nothing, but derived types are allowed to override it to inject required policies into registration.

Problem

  • This method is called even if nothing to register
  • The injection member is kept in memory even when policies are added to the registration.
  • Both of these, when not used add unnecessary overhead.

Solution

  • To optimize performance interface IAddPolicies should be implemented.

  • Injection Members requiring active registration must implement this interface.

  • Method AddPolicies(Type typeToCreate, IPolicyList policies) will be removed from InjectionMember as redundant.

Interface

    public interface IAddPolicies
    {
        public abstract void AddPolicies(Type type, string? name, ref IPolicySet policies)
    }

Impact

Custom Injection Members will require refactoring

@ENikS ENikS self-assigned this Sep 19, 2018
ENikS referenced this issue in unitycontainer/abstractions Sep 20, 2018
ENikS referenced this issue in unitycontainer/container Sep 20, 2018
ENikS referenced this issue in unitycontainer/interception Sep 20, 2018
ENikS referenced this issue in unitycontainer/unity Sep 20, 2018
@ENikS ENikS closed this as completed Jan 8, 2019
@ENikS ENikS reopened this Dec 21, 2019
@ENikS ENikS changed the title Optimize InjectionMember Optimize policy injection during registration Dec 21, 2019
ENikS referenced this issue in unitycontainer/abstractions Dec 21, 2019
@ENikS ENikS changed the title Optimize policy injection during registration Optimize AddPolicies calls during registration Dec 24, 2019
@ENikS ENikS changed the title Optimize AddPolicies calls during registration Implement IAddPolicies interface Jun 15, 2020
ENikS referenced this issue in unitycontainer/abstractions Jun 15, 2020
Fixed unitycontainer/abstractions#82
ENikS referenced this issue in unitycontainer/abstractions Jun 16, 2020
@ENikS ENikS transferred this issue from unitycontainer/abstractions Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant