Skip to content

TextLoader should have only one constructor, that doesn't take Arguments as a parameter #1611

Closed

Description

@markusweimer

TextLoader needs to hide the constructor that has Arguments, and also expose the HasHeader and SeparatorChars to be non-advanced parameters.

-- old description --
TextLoader presently accepts a parameter called column for the array of columns to read. That seems odd, given that almost always, multiple columns are passed. Hence, it would be more natural to call that parameter columns.

Activity

  1. markusweimer commented on Nov 13, 2018

    @markusweimer
    Author
  2. Zruty0 commented on Nov 14, 2018

    @Zruty0
    Contributor

    @markusweimer that's not exactly correct. TextLoader takes Arguments as a parameter, and the arguments class has a field called Column. This is actually a common pattern in our codebase to use singular nouns for things that are internally arrays: it's better in command line to have
    loader=Text{column=Foo:TX:0 column=Bar:R4:1}
    than it is to have
    loader=Text{columns=Foo:TX:0 columns=Bar:R4:1}.

    However, I don't think the constructor that takes TextLoader.Arguments needs to be public altogether. We should improve the other constructor to have non-advanced parameters, and also do #1515 .

  3. changed the title [-]TextLoader should use `columns` as a parameter, not `column`[/-] [+]TextLoader should have only one constructor, that doesn't take Arguments as a parameter[/+] on Nov 14, 2018
  4. Zruty0 commented on Nov 14, 2018

    @Zruty0
    Contributor

    I took a liberty to update the issue name and description. I kept the old one for history

  5. self-assigned this
    on Nov 28, 2018
  6. eerhardt commented on Nov 30, 2018

    @eerhardt
    Member

    See dotnet/apireviews#81 for some notes from the API design discussion on this API. In the end, we decided to have 2 constructor/factories:

    1. With the simple/common options as direct parameters.
    2. If a component needed to have public "advanced" options, have another constructor/factory that took only the Options instance.
  7. added this to the 1218 milestone on Dec 11, 2018
  8. ghost locked as resolved and limited conversation to collaborators on Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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