Skip to content

Simplify the ability to resolve available commands #3842

@AdmiringWorm

Description

@AdmiringWorm

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my request.

Is Your Feature Request Related To A Problem? Please describe.

When attempting to acquire commands to re-use in the application, we need to resolve all commands and use reflection to iterate through them to be able to find the command that we are interested in.

Describe The Solution. Why is it needed?

We need to determine what simplify in this context means.

We need to either extract the logic of finding the commands to its own extension method (possibly an extension on the IoC container) so that we do not have mixed logic between different places, and to ensure that we are consistent in how it is used.

Alternatively, we can look into if there are better ways of trying to find the command classes that we want, to try to avoid using reflections. One idea here is to maybe register each command class directly, and then have it added to an entire collection if we need to.
This could potentially be solved by making use of keyed names when registering as well.

User Story

As a maintainer of the application, or as an extension maintainer that needs to call other commands we need to currently duplicate the behaviour, and use reflection.
This is error prone, and can lead to runtime errors if done incorrectly.
I want to have the ability to re-use the logic of resolving commands in a standard, tested and simplified matter to avoid runtime errors from happening.

Additional Context

No response

Acceptance Criteria

  • Resolving commands has been simplified and/or standardized.
  • No behaviour runtime changes introduced (Run all unit/integration and e2e tests).

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - TriagingIssue is accepted, but a milestone has yet to be added for the issue.EnhancementIssues that introduce new functionality to the project, or enhances/updates existing functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions