{"id":14376,"date":"2021-09-19T11:19:30","date_gmt":"2021-09-19T02:19:30","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=14376"},"modified":"2023-05-27T18:35:07","modified_gmt":"2023-05-27T09:35:07","slug":"%e3%80%90ddd%e3%80%91%e3%80%8c%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%80%8d%e3%81%a8%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=14376","title":{"rendered":"\u3010DDD\u3011\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u300d\u3068\u306f\uff1f\u3001\u300c\u96c6\u7d04\u5ea6\u3092\u4e0a\u3052\u308b\u5de5\u592b\u300d"},"content":{"rendered":"<h2>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u3068\u306f\uff1f<\/h2>\n<p>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u306f\u5229\u7528\u8005\u306e\u76ee\u7684\u306b\u5fdc\u3058\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u304a\u308a\u3001\u30c9\u30e1\u30a4\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9\uff09\u3068\u306f\u6982\u5ff5\u7684\u306b\u306f\u5bfe\u6bd4\u3055\u308c\u308b\u6982\u5ff5\u3067\u3059\u3002<\/p>\n<h2>\u4f8b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u64cd\u4f5c\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u56fa\u6709\u306e\u632f\u308b\u821e\u3044\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30e6\u30fc\u30b6\u30fc\u3092\u767b\u9332\u3059\u308b\u3002<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u5909\u66f4\u3059\u308b\u3002<\/li>\n<\/ul>\n<h2>\u5b9f\u88c5<\/h2>\n<h3>\u547d\u540d<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u300cUserApplicationService\u300d<\/strong><\/span>\u306a\u3069\u3068\u547d\u540d\u3057\u307e\u3059\u3002<\/p>\n<p>\u30ec\u30dd\u30b8\u30c8\u30ea\u3084\u3001\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3068\u3057\u3066\u6301\u305f\u305b\u307e\u3059\u3002<\/p>\n<h3>\u767b\u9332\u7cfb<\/h3>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3092new\u3059\u308b\u3002<\/li>\n<li>\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9\u306e\u91cd\u8907\u30c1\u30a7\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/li>\n<li>\u30ec\u30dd\u30b8\u30c8\u30ea\u306e\u4fdd\u5b58\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true \">class xxxApplicationService {\r\n  private xxx\u30ec\u30dd\u30b8\u30c8\u30ea;\r\n  private xxx\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9;\r\n\r\n  xxxApplicationService(xxx\u30ec\u30dd\u30b8\u30c8\u30ea\u3001xxx\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9) {\r\n     xxx\u30ec\u30dd\u30b8\u30c8\u30ea = xxx\u30ec\u30dd\u30b8\u30c8\u30ea;\r\n     xxx\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9 = xxx\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9;\r\n  }\r\n\r\n   public void register(\u767b\u9332\u3059\u308b\u5024){\r\n     xxx = new XXX\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3(\u767b\u9332\u3059\u308b\u5024)\r\n\u3000\u3000\u3000\u3000\u3000if (xxx\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9.Exists(xxx)) {\r\n        \u4f8b\u5916\u51e6\u7406\uff08\u3059\u3067\u306bxxx\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\uff09\r\n     }\r\n     xxx\u30ec\u30dd\u30b8\u30c8\u30ea.save(xxx);\r\n   }\r\n\r\n}\r\n<\/pre>\n<h3>\u53d6\u5f97\u7cfb<\/h3>\n<ul>\n<li>\u30ec\u30dd\u30b8\u30c8\u30ea\u306e\u53d6\u5f97\u30e1\u30bd\u30c3\u30c9(find\u306a\u3069)\u3092\u5b9f\u884c\u3059\u308b\u3002<\/li>\n<\/ul>\n<h2>\u96c6\u7d04\u5ea6\u3092\u4e0a\u3052\u308b\u5de5\u592b\u3092\u3059\u308b\u3002<\/h2>\n<p>\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u300d\u306f\u96c6\u7d04\u5ea6\u3092\u4e0a\u3052\u3066\u5b9f\u88c5\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001UserApplicationService\u3068\u3044\u3046\u306e\u3092\u300cUserRegisterService\u300d\u3068\u300cUserDeleteService\u300d\u306b\u5206\u3051\u308b\u306a\u3069\u3067\u3059\u3002<\/p>\n<h3>\u306a\u305c\u304b<\/h3>\n<p>UserRegisterService\u3067\u306f\u4f7f\u3063\u3066\u3044\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u304c\u3042\u3063\u3066\u3082\u3001UserDeleteService\u3067\u306f\u4f7f\u3063\u3066\u3044\u306a\u3044\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306a\u3069\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u5206\u3051\u3066\u3042\u3063\u305f\u307b\u3046\u304c\u3088\u308a\u96c6\u7d04\u5ea6\u304c\u9ad8\u307e\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5168\u3066\u5206\u3051\u308c\u3070\u826f\u3044\u304b\uff1f<\/h3>\n<p>\u4e00\u6982\u306b\u305d\u3046\u3044\u3046\u308f\u3051\u3067\u3082\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u308a\u5dfb\u304f\u74b0\u5883\uff08\u5c06\u6765\u4e88\u6e2c\u306a\u3069\uff09\u306b\u3088\u3063\u3066\u306f\u3042\u3048\u3066\u96c6\u7d04\u5ea6\u3092\u4e0b\u3052\u308b\u3053\u3068\u304c\u6b63\u89e3\u306b\u3082\u306a\u308a\u3046\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30e1\u30bd\u30c3\u30c9\u540d\u306f\u3069\u3046\u3059\u308b\u306e\uff1f<\/h3>\n<p>\u96c6\u7d04\u5ea6\u3092\u4e0b\u3052\u3066\u3044\u308b\u72b6\u614b\u3067\u306fregister\u3084\u3001delete\u306a\u3069\u306e\u540d\u524d\u304c\u4f7f\u3048\u307e\u3057\u305f\u304c\u3001\u96c6\u7d04\u5ea6\u3092\u4e0a\u3052\u308b\u3068\u547d\u540d\u306b\u56f0\u308a\u307e\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u540d\u524d\u304c\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<ul>\n<li>handle<\/li>\n<li>execute<\/li>\n<li>perform<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u3068\u306f\uff1f \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u306f\u5229\u7528\u8005\u306e\u76ee\u7684\u306b\u5fdc\u3058\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u304a\u308a\u3001\u30c9\u30e1\u30a4\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30c9\u30e1\u30a4\u30f3\u30b5\u30fc\u30d3\u30b9\uff09\u3068\u306f\u6982\u5ff5\u7684\u306b\u306f\u5bfe\u6bd4\u3055\u308c\u308b\u6982\u5ff5\u3067\u3059 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[129],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14376"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14376"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14376\/revisions"}],"predecessor-version":[{"id":20161,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14376\/revisions\/20161"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14376"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}