{"action":"created","comment":{"url":"https://api.github.com/repos/AliSoftware/Dip/pulls/comments/43495124","id":43495124,"diff_hunk":"@@ -48,7 +50,7 @@ let providerDependencies = DependencyContainer<Int>() { dip in\n \n         // 2) Register the StarshipProviderAPI factories, one generic and one specific for a specific starshipID\n         dip.register() { HardCodedStarshipProvider() as StarshipProviderAPI }\n-        dip.register(0) { DummyStarshipProvider(pilotName: \"Main Pilot\") as StarshipProviderAPI }\n+        dip.register(NamedStarshipProviderTag) { DummyStarshipProvider(pilotName: \"Main Pilot\") as StarshipProviderAPI }","path":"Example/DipSampleApp/DependencyContainers.swift","position":34,"original_position":34,"commit_id":"10dd5a51a582dc24b9b43e32764dc2b53fb43b31","original_commit_id":"10dd5a51a582dc24b9b43e32764dc2b53fb43b31","user":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"body":"Same comment as for the `dip.register` or the `PersonProviderAPI`","created_at":"2015-10-30T12:07:27Z","updated_at":"2015-10-30T12:07:27Z","html_url":"https://github.com/AliSoftware/Dip/pull/3#discussion_r43495124","pull_request_url":"https://api.github.com/repos/AliSoftware/Dip/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/comments/43495124"},"html":{"href":"https://github.com/AliSoftware/Dip/pull/3#discussion_r43495124"},"pull_request":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/AliSoftware/Dip/pulls/3","id":48635538,"html_url":"https://github.com/AliSoftware/Dip/pull/3","diff_url":"https://github.com/AliSoftware/Dip/pull/3.diff","patch_url":"https://github.com/AliSoftware/Dip/pull/3.patch","issue_url":"https://api.github.com/repos/AliSoftware/Dip/issues/3","number":3,"state":"open","locked":false,"title":"Tags refactoring","user":{"login":"ilyapuchka","id":1488293,"avatar_url":"https://avatars.githubusercontent.com/u/1488293?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyapuchka","html_url":"https://github.com/ilyapuchka","followers_url":"https://api.github.com/users/ilyapuchka/followers","following_url":"https://api.github.com/users/ilyapuchka/following{/other_user}","gists_url":"https://api.github.com/users/ilyapuchka/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyapuchka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyapuchka/subscriptions","organizations_url":"https://api.github.com/users/ilyapuchka/orgs","repos_url":"https://api.github.com/users/ilyapuchka/repos","events_url":"https://api.github.com/users/ilyapuchka/events{/privacy}","received_events_url":"https://api.github.com/users/ilyapuchka/received_events","type":"User","site_admin":false},"body":"I noticed that at first tags were plain strings but then they changed to generics. In this pr I revert that change and here are my thoughts about that:\r\n\r\n1. In my experience of working with DI (particularly in Obj-C with Typhoon) I've never needed named registrations. In most cases the same could be achieved by creating different containers for different environments or using runtime arguments.\r\n\r\n2. Adding generic constraint on tag type adds type constraint on the whole container. I.e. it will be hard to add child-parent relationship between containers, or combine them in collection without introducing base protocol (what I think is useless at this point)\r\n\r\n3. Adding generic tags limits containers flexibility and functionality. If you set it once you have to use only this type of tag inside container, so you have to move components that need other tags to other containers. It can lead to enormous number of containers. For example it make sense to group instances from network layer in one container, but that instances can have different responsibilities and it will be hard to mark them with tag of one type in context of one container, so you will end up with no tags at all or using strings or ints (ints are much less expressive than strings in that case) or you will create a lot of small containers.\r\n\r\n4. At the end what our code can gain from using generic tags? Strings are rather expressive already. If you want safety you can always use string constants. Generics make containers code more complicated.\r\n\r\nIt would be interesting to know your motivation for moving to generic tags.","created_at":"2015-10-23T22:05:50Z","updated_at":"2015-10-30T12:07:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ac03f41c95f68c5e5892ab91038e587190441b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AliSoftware/Dip/pulls/3/commits","review_comments_url":"https://api.github.com/repos/AliSoftware/Dip/pulls/3/comments","review_comment_url":"https://api.github.com/repos/AliSoftware/Dip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AliSoftware/Dip/issues/3/comments","statuses_url":"https://api.github.com/repos/AliSoftware/Dip/statuses/10dd5a51a582dc24b9b43e32764dc2b53fb43b31","head":{"label":"ilyapuchka:master","ref":"master","sha":"10dd5a51a582dc24b9b43e32764dc2b53fb43b31","user":{"login":"ilyapuchka","id":1488293,"avatar_url":"https://avatars.githubusercontent.com/u/1488293?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyapuchka","html_url":"https://github.com/ilyapuchka","followers_url":"https://api.github.com/users/ilyapuchka/followers","following_url":"https://api.github.com/users/ilyapuchka/following{/other_user}","gists_url":"https://api.github.com/users/ilyapuchka/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyapuchka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyapuchka/subscriptions","organizations_url":"https://api.github.com/users/ilyapuchka/orgs","repos_url":"https://api.github.com/users/ilyapuchka/repos","events_url":"https://api.github.com/users/ilyapuchka/events{/privacy}","received_events_url":"https://api.github.com/users/ilyapuchka/received_events","type":"User","site_admin":false},"repo":{"id":44774753,"name":"Dip","full_name":"ilyapuchka/Dip","owner":{"login":"ilyapuchka","id":1488293,"avatar_url":"https://avatars.githubusercontent.com/u/1488293?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyapuchka","html_url":"https://github.com/ilyapuchka","followers_url":"https://api.github.com/users/ilyapuchka/followers","following_url":"https://api.github.com/users/ilyapuchka/following{/other_user}","gists_url":"https://api.github.com/users/ilyapuchka/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyapuchka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyapuchka/subscriptions","organizations_url":"https://api.github.com/users/ilyapuchka/orgs","repos_url":"https://api.github.com/users/ilyapuchka/repos","events_url":"https://api.github.com/users/ilyapuchka/events{/privacy}","received_events_url":"https://api.github.com/users/ilyapuchka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilyapuchka/Dip","description":"Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances!","fork":true,"url":"https://api.github.com/repos/ilyapuchka/Dip","forks_url":"https://api.github.com/repos/ilyapuchka/Dip/forks","keys_url":"https://api.github.com/repos/ilyapuchka/Dip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilyapuchka/Dip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilyapuchka/Dip/teams","hooks_url":"https://api.github.com/repos/ilyapuchka/Dip/hooks","issue_events_url":"https://api.github.com/repos/ilyapuchka/Dip/issues/events{/number}","events_url":"https://api.github.com/repos/ilyapuchka/Dip/events","assignees_url":"https://api.github.com/repos/ilyapuchka/Dip/assignees{/user}","branches_url":"https://api.github.com/repos/ilyapuchka/Dip/branches{/branch}","tags_url":"https://api.github.com/repos/ilyapuchka/Dip/tags","blobs_url":"https://api.github.com/repos/ilyapuchka/Dip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilyapuchka/Dip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilyapuchka/Dip/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilyapuchka/Dip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilyapuchka/Dip/statuses/{sha}","languages_url":"https://api.github.com/repos/ilyapuchka/Dip/languages","stargazers_url":"https://api.github.com/repos/ilyapuchka/Dip/stargazers","contributors_url":"https://api.github.com/repos/ilyapuchka/Dip/contributors","subscribers_url":"https://api.github.com/repos/ilyapuchka/Dip/subscribers","subscription_url":"https://api.github.com/repos/ilyapuchka/Dip/subscription","commits_url":"https://api.github.com/repos/ilyapuchka/Dip/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilyapuchka/Dip/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilyapuchka/Dip/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilyapuchka/Dip/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilyapuchka/Dip/contents/{+path}","compare_url":"https://api.github.com/repos/ilyapuchka/Dip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilyapuchka/Dip/merges","archive_url":"https://api.github.com/repos/ilyapuchka/Dip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilyapuchka/Dip/downloads","issues_url":"https://api.github.com/repos/ilyapuchka/Dip/issues{/number}","pulls_url":"https://api.github.com/repos/ilyapuchka/Dip/pulls{/number}","milestones_url":"https://api.github.com/repos/ilyapuchka/Dip/milestones{/number}","notifications_url":"https://api.github.com/repos/ilyapuchka/Dip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilyapuchka/Dip/labels{/name}","releases_url":"https://api.github.com/repos/ilyapuchka/Dip/releases{/id}","created_at":"2015-10-22T21:37:50Z","updated_at":"2015-10-22T21:37:51Z","pushed_at":"2015-10-29T18:50:30Z","git_url":"git://github.com/ilyapuchka/Dip.git","ssh_url":"git@github.com:ilyapuchka/Dip.git","clone_url":"https://github.com/ilyapuchka/Dip.git","svn_url":"https://github.com/ilyapuchka/Dip","homepage":null,"size":989,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AliSoftware:master","ref":"master","sha":"74112c6051b3f89fc989b9a2acfdbd565d57da0e","user":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"repo":{"id":43641724,"name":"Dip","full_name":"AliSoftware/Dip","owner":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AliSoftware/Dip","description":"Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances!","fork":false,"url":"https://api.github.com/repos/AliSoftware/Dip","forks_url":"https://api.github.com/repos/AliSoftware/Dip/forks","keys_url":"https://api.github.com/repos/AliSoftware/Dip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AliSoftware/Dip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AliSoftware/Dip/teams","hooks_url":"https://api.github.com/repos/AliSoftware/Dip/hooks","issue_events_url":"https://api.github.com/repos/AliSoftware/Dip/issues/events{/number}","events_url":"https://api.github.com/repos/AliSoftware/Dip/events","assignees_url":"https://api.github.com/repos/AliSoftware/Dip/assignees{/user}","branches_url":"https://api.github.com/repos/AliSoftware/Dip/branches{/branch}","tags_url":"https://api.github.com/repos/AliSoftware/Dip/tags","blobs_url":"https://api.github.com/repos/AliSoftware/Dip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AliSoftware/Dip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AliSoftware/Dip/git/refs{/sha}","trees_url":"https://api.github.com/repos/AliSoftware/Dip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AliSoftware/Dip/statuses/{sha}","languages_url":"https://api.github.com/repos/AliSoftware/Dip/languages","stargazers_url":"https://api.github.com/repos/AliSoftware/Dip/stargazers","contributors_url":"https://api.github.com/repos/AliSoftware/Dip/contributors","subscribers_url":"https://api.github.com/repos/AliSoftware/Dip/subscribers","subscription_url":"https://api.github.com/repos/AliSoftware/Dip/subscription","commits_url":"https://api.github.com/repos/AliSoftware/Dip/commits{/sha}","git_commits_url":"https://api.github.com/repos/AliSoftware/Dip/git/commits{/sha}","comments_url":"https://api.github.com/repos/AliSoftware/Dip/comments{/number}","issue_comment_url":"https://api.github.com/repos/AliSoftware/Dip/issues/comments{/number}","contents_url":"https://api.github.com/repos/AliSoftware/Dip/contents/{+path}","compare_url":"https://api.github.com/repos/AliSoftware/Dip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AliSoftware/Dip/merges","archive_url":"https://api.github.com/repos/AliSoftware/Dip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AliSoftware/Dip/downloads","issues_url":"https://api.github.com/repos/AliSoftware/Dip/issues{/number}","pulls_url":"https://api.github.com/repos/AliSoftware/Dip/pulls{/number}","milestones_url":"https://api.github.com/repos/AliSoftware/Dip/milestones{/number}","notifications_url":"https://api.github.com/repos/AliSoftware/Dip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AliSoftware/Dip/labels{/name}","releases_url":"https://api.github.com/repos/AliSoftware/Dip/releases{/id}","created_at":"2015-10-04T15:49:35Z","updated_at":"2015-10-28T21:39:22Z","pushed_at":"2015-10-29T18:50:30Z","git_url":"git://github.com/AliSoftware/Dip.git","ssh_url":"git@github.com:AliSoftware/Dip.git","clone_url":"https://github.com/AliSoftware/Dip.git","svn_url":"https://github.com/AliSoftware/Dip","homepage":null,"size":1124,"stargazers_count":32,"watchers_count":32,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/3"},"html":{"href":"https://github.com/AliSoftware/Dip/pull/3"},"issue":{"href":"https://api.github.com/repos/AliSoftware/Dip/issues/3"},"comments":{"href":"https://api.github.com/repos/AliSoftware/Dip/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AliSoftware/Dip/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/AliSoftware/Dip/statuses/10dd5a51a582dc24b9b43e32764dc2b53fb43b31"}}}}