Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make first runtime argument parameter named #18

Closed
ilyapuchka opened this issue Nov 26, 2015 · 6 comments
Closed

Make first runtime argument parameter named #18

ilyapuchka opened this issue Nov 26, 2015 · 6 comments
Labels
Milestone

Comments

@ilyapuchka
Copy link
Collaborator

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.

@AliSoftware
Copy link
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.

@ilyapuchka
Copy link
Collaborator Author

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

@AliSoftware
Copy link
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.

@AliSoftware
Copy link
Owner

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

@ilyapuchka
Copy link
Collaborator Author

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

@ilyapuchka
Copy link
Collaborator Author

Resolved by #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants