{"id":900,"date":"2017-02-07T00:50:07","date_gmt":"2017-02-06T15:50:07","guid":{"rendered":"http:\/\/okamurax.com\/?p=900"},"modified":"2020-05-05T01:03:52","modified_gmt":"2020-05-04T16:03:52","slug":"c-strategy","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=900","title":{"rendered":"C# Strategy"},"content":{"rendered":"<pre class=\"lang:c# decode:true  \">namespace ConsoleApplication1\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            Context c = new Context(new ConcreateStrategy1());\r\n            c.Method();\r\n        }\r\n    }\r\n\r\n    \/* Strategy \r\n    \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3060\u3051\u629c\u304d\u51fa\u3057\u3066\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u5207\u308a\u66ff\u3048\u3084\u3059\u304f\u3059\u308b\u3002*\/\r\n\r\n    class Context\r\n    {\r\n        private Strategy strategy = null;\r\n        public Context(Strategy strategy)\r\n        {\r\n            this.strategy = this.strategy = strategy;\r\n        }\r\n\r\n        public void Method()\r\n        {\r\n            this.strategy.Method();\r\n        }\r\n    }\r\n\r\n    interface Strategy\r\n    {\r\n        void Method();\r\n    }\r\n    class ConcreateStrategy1: Strategy\r\n    {\r\n        public void Method()\r\n        {\r\n            \/\/\u30a2\u30eb\u30b4\u30ea\u30ba\u30e01\r\n        }\r\n    }\r\n    class ConcreateStrategy2 : Strategy\r\n    {\r\n        public void Method()\r\n        {\r\n            \/\/\u30a2\u30eb\u30b4\u30ea\u30ba\u30e02\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Context c = new Context(new  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=900\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C# Strategy&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9,144],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-1","tag-c-net","tag-144"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=900"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/900\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/900\/revisions\/901"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}