Skip to content

No Arguments in Entry Points #261

Closed
Closed
@TomFinley

Description

@TomFinley

The entry points for certain components are incorrectly designed. Normally components for entry-points are instantiated and their parameters are set on the object directly. For some reason, a handful of components slipped through, by having a separate "arguments" object be set, rather than have the arguments on the object directly.

The most conspicuous example of this flaw is the text loader.

As we see in its usage here, we have the peculiar setup that we instantiate this, only to turn around and set a completely different object for its settings, which is completely wrong. Those parameters ought to be on the object itself.

var importData = new Data.TextLoader(dataPath)
{
Arguments = new TextLoaderArguments
{
Separator = new[] { ',' },

This extends beyond text loader. As near as I can tell, all classes in CSharpApi.cs with the suffix "argument" in its name is an example of this anti-pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIIssues pertaining the friendly APIenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions