{"id":898,"date":"2017-02-07T00:21:13","date_gmt":"2017-02-06T15:21:13","guid":{"rendered":"http:\/\/okamurax.com\/?p=898"},"modified":"2020-05-05T01:03:58","modified_gmt":"2020-05-04T16:03:58","slug":"c-bridge","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=898","title":{"rendered":"C# Bridge"},"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            \/\/abstraction\u751f\u6210\u6642\u306bConcreateImplementor\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u6e21\u3059\u3002\r\n            Abstraction abstraction = new Abstraction(new ConcreateImplementor());\r\n        }\r\n    }\r\n\r\n    \/* Bridge \u6a5f\u80fd\u3068\u5b9f\u88c5\u306e\u5206\u96e2 \r\n    \u6a5f\u80fd\u5b9f\u88c5\u306e\u5ea6\u306e\u7d99\u627f\u3092\u306a\u304f\u305f\u3081\u3001\u6a5f\u80fd\u5b9f\u88c5\u5c02\u7528\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3002 *\/\r\n\r\n    public class Abstraction\r\n    {\r\n        private Implementor implementor;\r\n\r\n        public void function()\r\n        {\r\n            \/\/\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u4fdd\u6301\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u51e6\u7406\u3092\u4efb\u305b\u308b\u3002\r\n            this.implementor.implementation();\r\n        }\r\n\r\n        public Abstraction(Implementor i)\r\n        {\r\n            this.implementor = i;\r\n        }\r\n    }\r\n\r\n    public class RefinedAbstraction: Abstraction\r\n    {\r\n        public RefinedAbstraction(Implementor i) : base(i)\r\n        {\r\n\r\n        }\r\n\r\n        public void RefinedMethod1()\r\n        {\r\n            \/\/\u8ffd\u52a0\u6a5f\u80fd\r\n        }\r\n    }\r\n\r\n    \/\/\u6a5f\u80fd\u5b9f\u88c5\u30af\u30e9\u30b9\u306e\u62bd\u8c61\u3068\u5177\u8c61\u3002\r\n\r\n    public abstract class Implementor\r\n    {\r\n        public abstract void implementation();\r\n    }\r\n\r\n    public class ConcreateImplementor: Implementor\r\n    {\r\n        public override void implementation()\r\n        {\r\n            \/\/\u5b9f\u88c5\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>namespace ConsoleApplication1 { class Program { static void Main(string[] args) { \/\/abstraction\u751f\u6210\u6642\u306bConcreateIm &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=898\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C# Bridge&#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-898","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\/898","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=898"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/898\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/898\/revisions\/899"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}