{"id":10458,"date":"2020-10-13T17:24:25","date_gmt":"2020-10-13T08:24:25","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10458"},"modified":"2022-01-20T14:06:28","modified_gmt":"2022-01-20T05:06:28","slug":"proxy-%ed%8c%a8%ed%84%b4","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10458","title":{"rendered":"[GoF] Proxy \ud328\ud134"},"content":{"rendered":"<h4>\ud328\ud134\uba85\uce6d<\/h4>\n<p>Proxy<\/p>\n<h4>\ud544\uc694\ud55c \uc0c1\ud669<\/h4>\n<p>\uc5b4\ub5a4 \uae30\ub2a5\uc744 \ubc14\ub85c \uc2e4\ud589\ud558\uae30\ubcf4\ub2e4\ub294 \ubaa8\uc558\ub2e4\uac00 \ud55c\ubc88\uc5d0 \uc2e4\ud589\ud558\ub3c4\ub85d \ud558\ub294 \uac83\uc774 \ud6a8\uc728\uc801\uc778 \uacbd\uc6b0\uc5d0 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ud328\ud134\uc774\ub2e4. \ub610\ub294 \uc5b4\ub5a4 \uc785\ub825\uac12\uc5d0 \ub300\ud55c \uacb0\uacfc\ub97c \ubcc4\ub3c4\ub85c \uc800\uc7a5\ud574 \ub480\ub2e4\uac00 \ub3d9\uc77c\ud55c \uc785\ub825\uac12\uc5d0 \ub300\ud55c \uacb0\uacfc\ub97c \ub2e4\uc2dc \uc694\uccad\ubc1b\uc558\uc744\ub54c \ubbf8\ub9ac \uc800\uc7a5\ud574\ub454 \uacb0\uacfc\ub97c \uc804\ub2ec\ud574 \uc18d\ub3c4 \ud5a5\uc0c1\uc744 \uaf64\ud560 \uc218 \uc788\ub294 \ud328\ud134\uc774\ub2e4.<\/p>\n<h4>\uc608\uc81c \ucf54\ub4dc <\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2020\/10\/proxy.png\" alt=\"\" width=\"791\" height=\"404\" class=\"aligncenter size-full wp-image-10459\" \/><\/p>\n<p>ScreenDisplay \ud074\ub798\uc2a4\ub294 \uc785\ub825 \ubb38\uc790\uc5f4\uc744 \ud654\uba74(Screen)\uc5d0 \ucd9c\ub825\ud55c\ub2e4. BufferDisplay\ub294 \uc785\ub825 \ubb38\uc790\uc5f4\uc744 \ubc14\ub85c \ucd9c\ub825\ud558\uc9c0 \uc54a\uace0 \uc77c\ub2e8 \ubaa8\uc740 \ud6c4\uc5d0 \uc815\ud574\uc9c4 \uac1c\uc218\ub9cc\ud07c \ubaa8\uc774\uba74 ScreenDisplay \ud074\ub798\uc2a4\uc758 \uac1d\uccb4\ub97c \uc774\uc6a9\ud574 \ud654\uba74\uc5d0 \ucd9c\ub825\ud55c\ub2e4. Display\ub294 \ucd9c\ub825\ud55c\ub77c\ub294 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc81c\uacf5\ud558\uba70 \uc774\ub97c \uad6c\ud604\ud558\ub294 BufferDisplay\uc640 ScreenDisplay\ub294 \uc0ac\uc6a9\uc790\uc758 \uc785\uc7a5\uc5d0\uc11c Display\ub85c \ub3d9\uc77c\ud558\uac8c \ub2e4\ub8f0 \uc218 \uc788\ub2e4.<\/p>\n<p>Display \uc778\ud130\ud398\uc774\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\npackage pattern;\r\n\r\npublic interface Display {\r\n\tvoid print(String content);\r\n}\r\n<\/pre>\n<p>ScreenDisplay \ud074\ub798\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\npackage pattern;\r\n\r\npublic class ScreenDisplay implements Display {\r\n\t@Override\r\n\tpublic void print(String content) {\r\n\t\tSystem.out.println(content);\r\n\t}\r\n}\r\n<\/pre>\n<p>BufferDisplay \ud074\ub798\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\npackage pattern;\r\n\r\nimport java.util.Iterator;\r\nimport java.util.LinkedList;\r\n\r\npublic class BufferDisplay implements Display {\r\n\tprivate LinkedList&lt;String> contents = new LinkedList&lt;String>();\r\n\tprivate ScreenDisplay screen = new ScreenDisplay();\r\n\tprivate int bufferSize;\r\n\t\r\n\tpublic BufferDisplay(int bufferSize) {\r\n\t\tthis.bufferSize = bufferSize;\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic void print(String content) {\r\n\t\tcontents.add(content);\r\n\t\t\r\n\t\tif(contents.size() == bufferSize) {\r\n\t\t\tIterator&lt;String> iter = contents.iterator();\r\n\t\t\twhile(iter.hasNext()) {\r\n\t\t\t\tString bufferedContent = iter.next();\r\n\t\t\t\tscreen.print(bufferedContent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p>\uc9c0\uae08\uae4c\uc9c0 \uc815\uc758\ub41c \ud074\ub798\uc2a4\ub97c \uc0ac\uc6a9\ud558\ub294 \ucf54\ub4dc\uac00 \uc815\uc758\ub41c User \ud074\ub798\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\npackage pattern;\r\n\r\npublic class User {\r\n\tpublic static void main(String[] args) {\r\n\t\tDisplay display = new BufferDisplay(3);\r\n\t\t\r\n\t\tdisplay.print(\"Hello.\");\r\n\t\tdisplay.print(\"My name is Endru.\");\r\n\t\tdisplay.print(\"What's you name?\");\r\n\t\tdisplay.print(\"I am 10 years old.\");\r\n\t\tdisplay.print(\"How old are you?\");\r\n\t}\r\n}\r\n<\/pre>\n<p>\uc2e4\ud589 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class='code'>\r\nHello.\r\nMy name is Endru.\r\nWhat's you name?\r\n<\/pre>\n<p>User \ud074\ub798\uc2a4\uc758 \ucf54\ub4dc\ub97c \ubcf4\uba74 \ucd1d 5\uac1c\uc758 \ubb38\uc790\uc5f4\uc744 \ucd9c\ub825\ud558\ub77c\uace0 \ud588\uc73c\ub098, \uc2e4\uc81c\ub85c\ub294 3\uac1c\uc758 \ubb38\uc790\uc5f4\ub9cc \ucd9c\ub825\ub41c\ub2e4. \uc774\ub294 BufferDisplay\uac00 5\uac1c\uc758 \ubb38\uc790\uc5f4\uc774 \ubaa8\uc544\uc9c0\ub294 \uacbd\uc6b0\uc5d0\ub9cc \uc2e4\uc81c\ub85c \ud654\uba74\uc5d0 \ucd9c\ub825\ud558\uae30 \ub54c\ubb38\uc774\ub2e4.<\/p>\n<div style='background:#efefef;border-radius:8px;padding:12px 24px'>\uc774 \uae00\uc740 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc124\uacc4\uc758 \uae30\ubc18\uc774 \ub418\ub294 GoF\uc758 \ub514\uc790\uc778\ud328\ud134\uc5d0 \ub300\ud55c \uac15\uc758\uc790\ub8cc\uc785\ub2c8\ub2e4. \uc644\uc804\ud55c \uc2e4\uc2b5\uc744 \uc704\ud574 \uc774 \uae00\uc5d0\uc11c \uc18c\uac1c\ud558\ub294 \ud074\ub798\uc2a4 \ub2e4\uc774\uc5b4\uadf8\ub7a8\uacfc \uc608\uc81c \ucf54\ub4dc\ub294 \uc644\uc804\ud558\uac8c \uc2e4\ud589\ub418\ub3c4\ub85d \uc81c\uacf5\ub418\uc9c0\ub9cc, \uc0c1\ub300\uc801\uc73c\ub85c \uc608\uc81c \ucf54\ub4dc\uc640 \uad00\ub828\ub41c \uc124\uba85\uc774 \ud568\ucd95\uc801\uc73c\ub85c \uc81c\uacf5\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uae00\uc5d0 \ub300\ud574 \uad81\uae08\ud55c \uc810\uc774 \uc788\uc73c\uba74 \ub313\uae00\uc744 \ud1b5\ud574 \ub0a8\uaca8\uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ud328\ud134\uba85\uce6d Proxy \ud544\uc694\ud55c \uc0c1\ud669 \uc5b4\ub5a4 \uae30\ub2a5\uc744 \ubc14\ub85c \uc2e4\ud589\ud558\uae30\ubcf4\ub2e4\ub294 \ubaa8\uc558\ub2e4\uac00 \ud55c\ubc88\uc5d0 \uc2e4\ud589\ud558\ub3c4\ub85d \ud558\ub294 \uac83\uc774 \ud6a8\uc728\uc801\uc778 \uacbd\uc6b0\uc5d0 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ud328\ud134\uc774\ub2e4. \ub610\ub294 \uc5b4\ub5a4 \uc785\ub825\uac12\uc5d0 \ub300\ud55c \uacb0\uacfc\ub97c \ubcc4\ub3c4\ub85c \uc800\uc7a5\ud574 \ub480\ub2e4\uac00 \ub3d9\uc77c\ud55c \uc785\ub825\uac12\uc5d0 \ub300\ud55c \uacb0\uacfc\ub97c \ub2e4\uc2dc \uc694\uccad\ubc1b\uc558\uc744\ub54c \ubbf8\ub9ac \uc800\uc7a5\ud574\ub454 \uacb0\uacfc\ub97c \uc804\ub2ec\ud574 \uc18d\ub3c4 \ud5a5\uc0c1\uc744 \uaf64\ud560 \uc218 \uc788\ub294 \ud328\ud134\uc774\ub2e4. \uc608\uc81c \ucf54\ub4dc ScreenDisplay \ud074\ub798\uc2a4\ub294 \uc785\ub825 \ubb38\uc790\uc5f4\uc744 \ud654\uba74(Screen)\uc5d0 \ucd9c\ub825\ud55c\ub2e4. BufferDisplay\ub294 \uc785\ub825 \ubb38\uc790\uc5f4\uc744 \ubc14\ub85c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10458\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[GoF] Proxy \ud328\ud134&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-10458","post","type-post","status-publish","format-standard","hentry","category-design"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10458"}],"version-history":[{"count":5,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10458\/revisions"}],"predecessor-version":[{"id":10462,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10458\/revisions\/10462"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10458"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}