Skip to content

Migrate ComponentFactory to Dependency Injection #3955

@SkyeHoefling

Description

@SkyeHoefling

Description of problem

The ComponentFactory was originally implemented prior to Dependency Injection in the Dnn Platform. It uses a very similar technique of registering types for static instantiation. It should be migrated to Dependency Injection

Description of solution

The solution I have in mind has 3 main components to it

  • Update the ComponentFactory implementation to use the Dependency Injection container to resolve all the types.
  • Change all ComponentFactory usages at app startup to use Dependency Injection instead.
  • Mark the ComponentFactory as deprecated to ensure modules and vendors use Dependency Injection instead.

Description of alternatives considered

Should DNN keep the API available for ComponentFactory?

Since Dnn has taken a strong opinion on Dependency Injection, I think it should deprecate the ComponentFactory otherwise it just means there is another API that needs to be maintained that does the same thing as Dependency Injection.

Screenshots

N/A

Additional context

The testing effort for this will be high

Affected browser

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions