Skip to content

Make first runtime argument parameter named #18

Closed

Description

@ilyapuchka

With introduction of runtime arguments (#8) the API became a bit confusing cause of mixing tags and arguments values. It would be better to use something like this:

container.register(tag: "tag") { (arg1: Arg1) in ... as Protocol }
container.resolve(tag: "tag", withArguments: arg1) as Protocol

To release this feature faster and without bumping major version (what we are going to do to release circular dependencies) we can leave old version and later (or can we do it right away?) deprecate it.

Activity

  1. AliSoftware commented on Nov 26, 2015

    @AliSoftware
    Owner

    I think we can wait a few days to integrate that at the same time as we release Circular Dependencies (hopefully this weekend). You might deprecate the old method right away in a 3.1.0 before 4.0.0 but I'm not sure that's worth it.

    Also see #16 (comment) : I couldn't think of a better name than withArguments: here, but maybe a little brainstorming is worth it before adopting that to ensure the name we choose is not confusing with a param expecting an array.

  2. ilyapuchka commented on Nov 26, 2015

    @ilyapuchka
    CollaboratorAuthor

    I think it's fine - code completion should make it clear that it's different arguments, not an array.

  3. AliSoftware commented on Nov 26, 2015

    @AliSoftware
    Owner

    True. I was worried about the version with one argument being Any it could actually accept an Array without complaining; but as you say, code completion will list all the possibilities with one to 6 arguments so this should be clear enough indeed.

  4. added this to the 4.0.0 milestone on Nov 26, 2015
  5. AliSoftware commented on Nov 26, 2015

    @AliSoftware
    Owner

    Dammit, you beat me to editing the wiki page, I conflicted with your edits when wanting to edit it 😄 fast guy 😉 👍

  6. ilyapuchka commented on Nov 26, 2015

    @ilyapuchka
    CollaboratorAuthor

    Last minutes before my wife takes me away to watch TV-show 😄

  7. ilyapuchka commented on Nov 30, 2015

    @ilyapuchka
    CollaboratorAuthor

    Resolved by #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions