{"action":"created","comment":{"url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/comments/48608265","id":48608265,"diff_hunk":"@@ -0,0 +1,26 @@\n+---\n+layout: pattern\n+title: Delegation\n+folder: delegation\n+permalink: /patterns/delegation/\n+categories: Behavioral\n+tags:\n+ - Java\n+ - Difficulty-Beginner\n+---\n+\n+**Also known as:** Proxy Chains\n+\n+**Intent:** It is a technique where an object expresses certain behavior to the outside but in \n+reality delegates responsibility for implementing that behaviour to an associated object. \n+\n+![alt text](./etc/delegation.png \"Delegate\")\n+\n+**Applicability:** Use the Delegate pattern in order to achieve the following\n+\n+* Reduce the coupling of methods to their class\n+* Components that behave identically, but realize that this situation can change in the future.\n+\n+**Credits**\n+\n+* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)","path":"delegation/index.md","position":26,"original_position":26,"commit_id":"17b889c31de2819f950d14e04c0a03795a5362d7","original_commit_id":"17b889c31de2819f950d14e04c0a03795a5362d7","user":{"login":"iluwatar","id":582346,"avatar_url":"https://avatars.githubusercontent.com/u/582346?v=3","gravatar_id":"","url":"https://api.github.com/users/iluwatar","html_url":"https://github.com/iluwatar","followers_url":"https://api.github.com/users/iluwatar/followers","following_url":"https://api.github.com/users/iluwatar/following{/other_user}","gists_url":"https://api.github.com/users/iluwatar/gists{/gist_id}","starred_url":"https://api.github.com/users/iluwatar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iluwatar/subscriptions","organizations_url":"https://api.github.com/users/iluwatar/orgs","repos_url":"https://api.github.com/users/iluwatar/repos","events_url":"https://api.github.com/users/iluwatar/events{/privacy}","received_events_url":"https://api.github.com/users/iluwatar/received_events","type":"User","site_admin":false},"body":"I think Delegate pattern is not in this book.","created_at":"2015-12-30T15:05:29Z","updated_at":"2015-12-30T15:05:29Z","html_url":"https://github.com/iluwatar/java-design-patterns/pull/330#discussion_r48608265","pull_request_url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330","_links":{"self":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/comments/48608265"},"html":{"href":"https://github.com/iluwatar/java-design-patterns/pull/330#discussion_r48608265"},"pull_request":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330"}}},"pull_request":{"url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330","id":54688817,"html_url":"https://github.com/iluwatar/java-design-patterns/pull/330","diff_url":"https://github.com/iluwatar/java-design-patterns/pull/330.diff","patch_url":"https://github.com/iluwatar/java-design-patterns/pull/330.patch","issue_url":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/330","number":330,"state":"open","locked":false,"title":"Delegation Pattern","user":{"login":"mikulucky","id":4526195,"avatar_url":"https://avatars.githubusercontent.com/u/4526195?v=3","gravatar_id":"","url":"https://api.github.com/users/mikulucky","html_url":"https://github.com/mikulucky","followers_url":"https://api.github.com/users/mikulucky/followers","following_url":"https://api.github.com/users/mikulucky/following{/other_user}","gists_url":"https://api.github.com/users/mikulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/mikulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikulucky/subscriptions","organizations_url":"https://api.github.com/users/mikulucky/orgs","repos_url":"https://api.github.com/users/mikulucky/repos","events_url":"https://api.github.com/users/mikulucky/events{/privacy}","received_events_url":"https://api.github.com/users/mikulucky/received_events","type":"User","site_admin":false},"body":"Delegation Pattern Implemented as requested by issue #324 should also be noted unit tests have been provided so updates required to #293 by adding and checking it off.","created_at":"2015-12-28T22:31:22Z","updated_at":"2015-12-30T15:05:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7abffdc4fff31f7a7d842040563daff8dd714196","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330/commits","review_comments_url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330/comments","review_comment_url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/330/comments","statuses_url":"https://api.github.com/repos/iluwatar/java-design-patterns/statuses/17b889c31de2819f950d14e04c0a03795a5362d7","head":{"label":"mikulucky:master","ref":"master","sha":"17b889c31de2819f950d14e04c0a03795a5362d7","user":{"login":"mikulucky","id":4526195,"avatar_url":"https://avatars.githubusercontent.com/u/4526195?v=3","gravatar_id":"","url":"https://api.github.com/users/mikulucky","html_url":"https://github.com/mikulucky","followers_url":"https://api.github.com/users/mikulucky/followers","following_url":"https://api.github.com/users/mikulucky/following{/other_user}","gists_url":"https://api.github.com/users/mikulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/mikulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikulucky/subscriptions","organizations_url":"https://api.github.com/users/mikulucky/orgs","repos_url":"https://api.github.com/users/mikulucky/repos","events_url":"https://api.github.com/users/mikulucky/events{/privacy}","received_events_url":"https://api.github.com/users/mikulucky/received_events","type":"User","site_admin":false},"repo":{"id":48302802,"name":"java-design-patterns","full_name":"mikulucky/java-design-patterns","owner":{"login":"mikulucky","id":4526195,"avatar_url":"https://avatars.githubusercontent.com/u/4526195?v=3","gravatar_id":"","url":"https://api.github.com/users/mikulucky","html_url":"https://github.com/mikulucky","followers_url":"https://api.github.com/users/mikulucky/followers","following_url":"https://api.github.com/users/mikulucky/following{/other_user}","gists_url":"https://api.github.com/users/mikulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/mikulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikulucky/subscriptions","organizations_url":"https://api.github.com/users/mikulucky/orgs","repos_url":"https://api.github.com/users/mikulucky/repos","events_url":"https://api.github.com/users/mikulucky/events{/privacy}","received_events_url":"https://api.github.com/users/mikulucky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikulucky/java-design-patterns","description":"Design patterns implemented in Java","fork":true,"url":"https://api.github.com/repos/mikulucky/java-design-patterns","forks_url":"https://api.github.com/repos/mikulucky/java-design-patterns/forks","keys_url":"https://api.github.com/repos/mikulucky/java-design-patterns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikulucky/java-design-patterns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikulucky/java-design-patterns/teams","hooks_url":"https://api.github.com/repos/mikulucky/java-design-patterns/hooks","issue_events_url":"https://api.github.com/repos/mikulucky/java-design-patterns/issues/events{/number}","events_url":"https://api.github.com/repos/mikulucky/java-design-patterns/events","assignees_url":"https://api.github.com/repos/mikulucky/java-design-patterns/assignees{/user}","branches_url":"https://api.github.com/repos/mikulucky/java-design-patterns/branches{/branch}","tags_url":"https://api.github.com/repos/mikulucky/java-design-patterns/tags","blobs_url":"https://api.github.com/repos/mikulucky/java-design-patterns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikulucky/java-design-patterns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikulucky/java-design-patterns/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikulucky/java-design-patterns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikulucky/java-design-patterns/statuses/{sha}","languages_url":"https://api.github.com/repos/mikulucky/java-design-patterns/languages","stargazers_url":"https://api.github.com/repos/mikulucky/java-design-patterns/stargazers","contributors_url":"https://api.github.com/repos/mikulucky/java-design-patterns/contributors","subscribers_url":"https://api.github.com/repos/mikulucky/java-design-patterns/subscribers","subscription_url":"https://api.github.com/repos/mikulucky/java-design-patterns/subscription","commits_url":"https://api.github.com/repos/mikulucky/java-design-patterns/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikulucky/java-design-patterns/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikulucky/java-design-patterns/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikulucky/java-design-patterns/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikulucky/java-design-patterns/contents/{+path}","compare_url":"https://api.github.com/repos/mikulucky/java-design-patterns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikulucky/java-design-patterns/merges","archive_url":"https://api.github.com/repos/mikulucky/java-design-patterns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikulucky/java-design-patterns/downloads","issues_url":"https://api.github.com/repos/mikulucky/java-design-patterns/issues{/number}","pulls_url":"https://api.github.com/repos/mikulucky/java-design-patterns/pulls{/number}","milestones_url":"https://api.github.com/repos/mikulucky/java-design-patterns/milestones{/number}","notifications_url":"https://api.github.com/repos/mikulucky/java-design-patterns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikulucky/java-design-patterns/labels{/name}","releases_url":"https://api.github.com/repos/mikulucky/java-design-patterns/releases{/id}","created_at":"2015-12-20T01:00:47Z","updated_at":"2015-12-27T14:16:28Z","pushed_at":"2015-12-29T23:12:04Z","git_url":"git://github.com/mikulucky/java-design-patterns.git","ssh_url":"git@github.com:mikulucky/java-design-patterns.git","clone_url":"https://github.com/mikulucky/java-design-patterns.git","svn_url":"https://github.com/mikulucky/java-design-patterns","homepage":"http://java-design-patterns.com","size":8453,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"iluwatar:master","ref":"master","sha":"8b020837eaacc9ed4497f3c2461984935314bfb8","user":{"login":"iluwatar","id":582346,"avatar_url":"https://avatars.githubusercontent.com/u/582346?v=3","gravatar_id":"","url":"https://api.github.com/users/iluwatar","html_url":"https://github.com/iluwatar","followers_url":"https://api.github.com/users/iluwatar/followers","following_url":"https://api.github.com/users/iluwatar/following{/other_user}","gists_url":"https://api.github.com/users/iluwatar/gists{/gist_id}","starred_url":"https://api.github.com/users/iluwatar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iluwatar/subscriptions","organizations_url":"https://api.github.com/users/iluwatar/orgs","repos_url":"https://api.github.com/users/iluwatar/repos","events_url":"https://api.github.com/users/iluwatar/events{/privacy}","received_events_url":"https://api.github.com/users/iluwatar/received_events","type":"User","site_admin":false},"repo":{"id":22790488,"name":"java-design-patterns","full_name":"iluwatar/java-design-patterns","owner":{"login":"iluwatar","id":582346,"avatar_url":"https://avatars.githubusercontent.com/u/582346?v=3","gravatar_id":"","url":"https://api.github.com/users/iluwatar","html_url":"https://github.com/iluwatar","followers_url":"https://api.github.com/users/iluwatar/followers","following_url":"https://api.github.com/users/iluwatar/following{/other_user}","gists_url":"https://api.github.com/users/iluwatar/gists{/gist_id}","starred_url":"https://api.github.com/users/iluwatar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iluwatar/subscriptions","organizations_url":"https://api.github.com/users/iluwatar/orgs","repos_url":"https://api.github.com/users/iluwatar/repos","events_url":"https://api.github.com/users/iluwatar/events{/privacy}","received_events_url":"https://api.github.com/users/iluwatar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iluwatar/java-design-patterns","description":"Design patterns implemented in Java","fork":false,"url":"https://api.github.com/repos/iluwatar/java-design-patterns","forks_url":"https://api.github.com/repos/iluwatar/java-design-patterns/forks","keys_url":"https://api.github.com/repos/iluwatar/java-design-patterns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iluwatar/java-design-patterns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iluwatar/java-design-patterns/teams","hooks_url":"https://api.github.com/repos/iluwatar/java-design-patterns/hooks","issue_events_url":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/events{/number}","events_url":"https://api.github.com/repos/iluwatar/java-design-patterns/events","assignees_url":"https://api.github.com/repos/iluwatar/java-design-patterns/assignees{/user}","branches_url":"https://api.github.com/repos/iluwatar/java-design-patterns/branches{/branch}","tags_url":"https://api.github.com/repos/iluwatar/java-design-patterns/tags","blobs_url":"https://api.github.com/repos/iluwatar/java-design-patterns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iluwatar/java-design-patterns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iluwatar/java-design-patterns/git/refs{/sha}","trees_url":"https://api.github.com/repos/iluwatar/java-design-patterns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iluwatar/java-design-patterns/statuses/{sha}","languages_url":"https://api.github.com/repos/iluwatar/java-design-patterns/languages","stargazers_url":"https://api.github.com/repos/iluwatar/java-design-patterns/stargazers","contributors_url":"https://api.github.com/repos/iluwatar/java-design-patterns/contributors","subscribers_url":"https://api.github.com/repos/iluwatar/java-design-patterns/subscribers","subscription_url":"https://api.github.com/repos/iluwatar/java-design-patterns/subscription","commits_url":"https://api.github.com/repos/iluwatar/java-design-patterns/commits{/sha}","git_commits_url":"https://api.github.com/repos/iluwatar/java-design-patterns/git/commits{/sha}","comments_url":"https://api.github.com/repos/iluwatar/java-design-patterns/comments{/number}","issue_comment_url":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/comments{/number}","contents_url":"https://api.github.com/repos/iluwatar/java-design-patterns/contents/{+path}","compare_url":"https://api.github.com/repos/iluwatar/java-design-patterns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iluwatar/java-design-patterns/merges","archive_url":"https://api.github.com/repos/iluwatar/java-design-patterns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iluwatar/java-design-patterns/downloads","issues_url":"https://api.github.com/repos/iluwatar/java-design-patterns/issues{/number}","pulls_url":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls{/number}","milestones_url":"https://api.github.com/repos/iluwatar/java-design-patterns/milestones{/number}","notifications_url":"https://api.github.com/repos/iluwatar/java-design-patterns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iluwatar/java-design-patterns/labels{/name}","releases_url":"https://api.github.com/repos/iluwatar/java-design-patterns/releases{/id}","created_at":"2014-08-09T16:45:18Z","updated_at":"2015-12-30T13:46:17Z","pushed_at":"2015-12-29T22:25:42Z","git_url":"git://github.com/iluwatar/java-design-patterns.git","ssh_url":"git@github.com:iluwatar/java-design-patterns.git","clone_url":"https://github.com/iluwatar/java-design-patterns.git","svn_url":"https://github.com/iluwatar/java-design-patterns","homepage":"http://java-design-patterns.com","size":9468,"stargazers_count":9385,"watchers_count":9385,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3026,"mirror_url":null,"open_issues_count":126,"forks":3026,"open_issues":126,"watchers":9385,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330"},"html":{"href":"https://github.com/iluwatar/java-design-patterns/pull/330"},"issue":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/330"},"comments":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/issues/330/comments"},"review_comments":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330/comments"},"review_comment":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/pulls/330/commits"},"statuses":{"href":"https://api.github.com/repos/iluwatar/java-design-patterns/statuses/17b889c31de2819f950d14e04c0a03795a5362d7"}}}}