Skip to content

Replace SubComponent with IComponentFactory #585

Closed
@eerhardt

Description

@eerhardt

When a component is structured in a way that it can use some other component, we are currently using a SubComponent object to specify which other component to use. For example, our One-Versus-All (Ova) class can turn any binary classifier into a multi-class classifier. So it has a SubComponent PredictorType field on its Arguments class, and users can specify which binary classifier that Ova should use.

The issues with SubComponent are:

  1. They depend on Dependency Injection in order to create the object.
  2. They use "magic strings" in order to create the object (since SubComponents are just strings to tell the DI system how to create the object).

In our main API, we shouldn't be using magic strings, or dependency injection, when you can simply just create objects, or delegates/factories, like a normal OOP API would work.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions