{"id":4822,"date":"2020-12-31T08:19:40","date_gmt":"2020-12-30T23:19:40","guid":{"rendered":"https:\/\/taki-lab.site\/bocci\/?p=4822"},"modified":"2020-12-31T08:19:43","modified_gmt":"2020-12-30T23:19:43","slug":"%e3%83%87%e3%82%b6%e3%82%a4%e3%83%b3%e3%83%91%e3%82%bf%e3%83%bc%e3%83%b3%e3%80%91decorator%e3%83%91%e3%82%bf%e3%83%bc%e3%83%b3","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=4822","title":{"rendered":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Decorator\u30d1\u30bf\u30fc\u30f3"},"content":{"rendered":"\n<p>Decorator\u30d1\u30bf\u30fc\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package org.example.decorator;\r\n\r\npublic abstract class Component {\r\n    public abstract void method1();\r\n    public abstract void method2();\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package org.example.decorator;\r\n\r\npublic class ConcreteComponent extends Component {\r\n    @Override\r\n    public void method1() {\r\n\r\n    }\r\n\r\n    @Override\r\n    public void method2() {\r\n\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package org.example.decorator;\r\n\r\npublic abstract class Decorator extends Component {\r\n    protected Component component;\r\n\r\n    protected Decorator(Component component) {\r\n        super();\r\n        this.component = component;\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package org.example.decorator;\r\n\r\npublic class ConcreteDecorator extends Decorator {\r\n    protected ConcreteDecorator(Component component) {\r\n        super(component);\r\n    }\r\n\r\n    @Override\r\n    public void method1() {\r\n\r\n    }\r\n\r\n    @Override\r\n    public void method2() {\r\n\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package org.example.decorator;\r\n\r\npublic class Main {\r\n    public static void main(String&#91;] args)\r\n    {\r\n        Component component = new ConcreteComponent();\r\n        Component instance = new ConcreteDecorator(component);\r\n        instance.method1();\r\n        instance.method2();\r\n\r\n        Component component1 = new ConcreteDecorator(new ConcreteDecorator(component));\r\n        component1.method1();\r\n        component1.method2();\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u4e2d\u8eab(ConcreteComponent)\u3068\u88c5\u98fe(ConcreteDecorator)\u304c\u5b58\u5728\u3057\u3001Component\u3068\u3044\u3046\u5171\u901a\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306fDecoreter\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u6a5f\u80fd\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>ConcreteDecorator\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u306fConcreteComponent\u3092\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001\u3059\u3067\u306b\u4f5c\u6210\u3057\u305fConcreteDecorator\u3092\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u3001\u305d\u308c\u306b\u3088\u3063\u3066\u518d\u5e30\u7684\u306a\u51e6\u7406\u3092\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u30af\u30e9\u30b9\u306e\u95a2\u4fc2\u304c\u8907\u96d1\u306b\u306a\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u3001\u30af\u30e9\u30b9\u56f3\u306b\u3088\u308b\u6574\u7406\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/\/blog.with2.net\/link\/?2023426:1010\" target=\"_blank\" rel=\"noreferrer noopener\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/03a6eee54039f74ded0b8f7548b1868f.png?w=474\" alt=\"\" title=\"\u30d1\u30bd\u30b3\u30f3\u30e9\u30f3\u30ad\u30f3\u30b0\"\/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Decorator\u30d1\u30bf\u30fc\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002 \u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u4e2d\u8eab(ConcreteComponent)\u3068\u88c5\u98fe(ConcreteDecorator)\u304c\u5b58\u5728\u3057\u3001Component\u3068\u3044\u3046\u5171\u901a\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6301\u3063\u3066\u3044 &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=4822\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Decorator\u30d1\u30bf\u30fc\u30f3<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Decorator\u30d1\u30bf\u30fc\u30f3\n#TechCommit\n","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[225,3],"tags":[226],"class_list":["post-4822","post","type-post","status-publish","format-standard","hentry","category-225","category-3","tag-226"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-1fM","jetpack-related-posts":[{"id":4776,"url":"https:\/\/taki-lab.site\/bocci\/?p=4776","url_meta":{"origin":4822,"position":0},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Composite\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2020\u5e7412\u670824\u65e5","format":false,"excerpt":"Composite\u30d1\u30bf\u30fc\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002 package org.example.compo\u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4737,"url":"https:\/\/taki-lab.site\/bocci\/?p=4737","url_meta":{"origin":4822,"position":1},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Bridge\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2020\u5e7412\u670817\u65e5","format":false,"excerpt":"Bridge\u30d1\u30bf\u30fc\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002 package org.example.bridge; \u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4554,"url":"https:\/\/taki-lab.site\/bocci\/?p=4554","url_meta":{"origin":4822,"position":2},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011AbstructFACTORY\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2020\u5e7411\u670813\u65e5","format":false,"excerpt":"AbstructFactory\u30d1\u30bf\u30fc\u30f3\u306e\u30b3\u30fc\u30c9\u4f8b\u3067\u3059\u3002 package org.example.ab\u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6620,"url":"https:\/\/taki-lab.site\/bocci\/?p=6620","url_meta":{"origin":4822,"position":3},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Mediator\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2021\u5e747\u670825\u65e5","format":false,"excerpt":"\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8(Colleague)\u306e\u5236\u5fa1\u3092\u884c\u3046\u306e\u306bMediator\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u3053\u308c\u3092\u4ecb\u3057\u3066\u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8346,"url":"https:\/\/taki-lab.site\/bocci\/?p=8346","url_meta":{"origin":4822,"position":4},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Template Method\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2022\u5e745\u670815\u65e5","format":false,"excerpt":"Template Method\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u6c7a\u307e\u308a\u5207\u3063\u3066\u3044\u308b\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30d1\u30bf\u30fc\u30f3\u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4619,"url":"https:\/\/taki-lab.site\/bocci\/?p=4619","url_meta":{"origin":4822,"position":5},"title":"\u3010\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3011Prototype\u30d1\u30bf\u30fc\u30f3","author":"taki","date":"2020\u5e7411\u670826\u65e5","format":false,"excerpt":"Prototype\u30d1\u30bf\u30fc\u30f3\u306e\u30b3\u30fc\u30c8\u4f8b\u3067\u3059\u3002 package org.example.prototyp\u2026","rel":"","context":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","block_context":{"text":"\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3","link":"https:\/\/taki-lab.site\/bocci\/?cat=225"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4822"}],"version-history":[{"count":1,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4822\/revisions"}],"predecessor-version":[{"id":4823,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4822\/revisions\/4823"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}