Re: Let's change to: Query Objects vs Methods on a Repository

"[email protected] [domaindrivendesign]" <[email protected]> 10 Mar 2017 04:26:01 +0000
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
--9nlWnTS9ocNmxdhsK3FKVLWiM6a5jwOaA8HvrLV
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="UTF-8"

QXMgcGVyIERERCwgUmVwb3NpdG9yeSBjYW4gZmV0Y2ggdGhlIGVudGlyZSBhZ2dyZWdhdGUgYW5k
IGl0IHNob3VsZCBsb2FkIGVhZ2VybHkgYWxsIG9mIGl0cyBjbHVzdGVyICh2YWx1ZW9iamVjdHMg
b3IgY2hpbGQgZW50aXRpZXMpIEN1c3RvbWVyIFJlcG9zaXRvcnkgY2FuIGhhbmRsZSBjdXN0b21l
ciBhZ2dyZWdhdGUgb25seS4gSSBjYW4gZG8gcmVhZCBvciB3cml0ZSBvbiBjdXN0b21lciBhZ2dy
ZWdhdGUgb25seS4gSSBjYW4gbm90IGZldGNoIHNvbWV0aGluZyBkaWZmZXJlbnQgIG9yIGRpZmZl
cmVudCBjbHVzdGVyIG9mIG90aGVyIG9iamVjdHMgdXNpbmcgQ3VzdG9tZXIgUmVwb3NpdG9yeS4g
ICANCiBIb3dldmVyIGlmIHdlIHdhbnQgdG8gY3JlYXRlIGEgcXVlcnkgYSBxdWVyeSBtb2RlbCB3
aGVyZSB3ZSBkbyBub3Qgd2FudCB0aGUgZW50aXJlIGFnZ3JlZ2F0ZSB0byBiZSBmZXRjaGVkLiBU
aGVuIGl0IGlzIG5vdCBwb3NzaWJsZSBkb2luZyB0aGF0IHVzaW5nIFJlcG9zaXRvcnkuIA0KIA0K
DQogSSB1bmRlcnN0b29kIHRoYXQgeW91IHdlcmUgc2F5aW5nIHRoZXJlIHNob3VsZCBiZSBzZXBh
cmF0ZSBxdWVyeSBtb2RlbCBpbiBvcmRlciB0byBpbXByb3ZlIHBlcmZvcm1hbmNlLiBJbiB0aGF0
IHNpdHVhdGlvbiBFaXRoZXIgd2Ugd2lsbCBlbmQgdXAgY3JlYXRpbmcgc2VwYXJhdGUgcmVhZCBt
b2RlbCBhbmQgaXRzIGNvcnJlc3BvbmRpbmcgUmVwb3NpdG9yeSBXaGljaCBvbmx5IG1hZGUgZm9y
IFF1ZXJ5IGFuZCB0aGF0IG1heSBmZXRjaCBhbnkgY29tYmluYXRpb24gb2Ygb2JqZWN0cyBpbiBy
ZWFkIHZpZXcgbW9kZWwgdGFibGVzLiBUaGVuIGluIHRoYXQgY2FzZSB5ZXMgSSBhZ3JlZSBpZiBh
bnkgb25lIHF1ZXJ5IGNoYW5nZSB0aGVuIGVudGlyZSByZXBvc2l0b3J5IGhhcyB0byBiZSB1cGRh
dGVkLiBBbmQgSSB3b3VsZCB0aGF0IHRpbWUgcHJlZmVyIHRvIGdvIHdpdGggb25lIHN0cmF0ZWd5
IHBlciBxdWVyeS4gQWxzbyBpdCBmaXRzIHdpdGggREREIFJlcG9zaXRvcnkgYXJlIG9ubHkgbWFk
ZSBmb3IgQWdncmVnYXRlLiBGb3IgUmVhZCBtb2RlbCB3ZSBtYXkgbm90IG5lZWQgcmVwb3NpdG9y
eS4NCiANCg0KIEkgd291bGQgcmF0aGVyIGdvIGJ5IFJlYWQgTW9kZWwgYW5kIGNyZWF0aW5nIHZh
cmlvdXMgRmV0Y2hpbmcgU3RyYWdnbGVzIG9yIFJvbGVzIGJhc2VkIG9uIHRoZSBQYWdlIFZpZXcg
TW9kZWxzLiANCiANCg0KIFRoYW5rcyANCiBSdXBlc2ggS3VtYXIgVGl3YXJpDQoNCg==


--9nlWnTS9ocNmxdhsK3FKVLWiM6a5jwOaA8HvrLV
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit





<head>

<style type="text/css">
<!--

/* start of attachment style */
       .ygrp-photo-title{
         clear: both;
         font-size: smaller;
         height: 15px;
         overflow: hidden;
         text-align: center;
         width: 75px;
       }
       div.ygrp-photo{
         background-position: center;
         background-repeat: no-repeat;
         background-color: white;
         border: 1px solid black;
         height: 62px;
         width: 62px;
       }

       div.photo-title 
         a,
         div.photo-title a:active,
         div.photo-title a:hover,
         div.photo-title a:visited {
           text-decoration: none; 
       }

       div.attach-table div.attach-row {
         clear: both;
       }

       div.attach-table div.attach-row div {
         float: left;
         /* margin: 2px;*/
       }

       p {
         clear: both;
         padding: 15px 0 3px 0;
	 overflow: hidden;
       }

       div.ygrp-file {
         width: 30px;
         valign: middle;
       }
       div.attach-table div.attach-row div div a {
         text-decoration: none;
       }

       div.attach-table div.attach-row div div span {
         font-weight: normal;
       }

       div.ygrp-file-title {
         font-weight: bold;
       }
 /* end of attachment style */
        -->
        </style>
        </head>
<html>
<head>
<style type="text/css">
<!--
#ygrp-mkp {
  border: 1px solid #d8d8d8;
  font-family: Arial;
  margin: 10px 0;
  padding: 0 10px;
}

#ygrp-mkp hr {
  border: 1px solid #d8d8d8;
}

#ygrp-mkp #hd {
  color: #628c2a;
  font-size: 85%;
  font-weight: 700;
  line-height: 122%;
  margin: 10px 0;
}

#ygrp-mkp #ads {
  margin-bottom: 10px;
}

#ygrp-mkp .ad {
  padding: 0 0;
}

#ygrp-mkp .ad p {
  margin: 0;
}

#ygrp-mkp .ad a {
  color: #0000ff;
  text-decoration: none;
}
-->
</style>
</head>
<body>



<!-- |**|begin egp html banner|**| -->

<br><br>

<!-- |**|end egp html banner|**| -->


As per DDD, Repository can fetch the entire aggregate and it should load eagerly all of its cluster (valueobjects or child entities) Customer Repository can handle customer aggregate only. I can do read or write on customer aggregate only. I can not fetch something different &nbsp;or different cluster of other objects using Customer Repository. &nbsp;<div><br><div>However if we want to create a query a query model where we do not want the entire aggregate to be fetched. Then it is not possible doing that using Repository.&nbsp;</div><div><br></div><div>I understood that you were saying there should be separate query model in order to improve performance. In that situation Either we will end up creating separate read model and its corresponding Repository Which only made for Query and that 
 may fetch any combination of objects in read view model tables. Then in that case yes I agree if any one query change then entire repository has to be updated. And I would that time prefer to go with one strategy per query. Also it fits with DDD Repository are only made for Aggregate. For Read model we may not need repository.</div><div><br></div><div>I would rather go by Read Model and creating various Fetching Straggles or Roles based on the Page View Models.&nbsp;</div><div><br></div><div>Thanks&nbsp;</div><div>Rupesh Kumar Tiwari</div></div>



<!-- |**|begin egp html banner|**| -->

<br>


<br>

<!-- |**|end egp html banner|**| -->


<div width="1" style="color: white; clear: both;"/>__._,_.___</div>

      
  

    
    <div id="fromDMARC" style="clear:both; margin-top: 10px;">
         <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
         Posted by: [email protected]         <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
    </div>
<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- |**|begin egp html banner|**| -->

  <img src="http://geo.yahoo.com/serv?s=97476590/grpId=8116923/grpspId=1705007181/msgId=24817/stime=1489382127" width="1" height="1"> <br>

<!-- |**|end egp html banner|**| -->

  
<!-- |**|begin egp html banner|**| -->

<br>



   
     
 
        <!-- |**|begin egp html banner|**| -->
        <div id="ygrp-vital" style="background-color: #f2f2f2; font-family: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">

        <span id="vithd" style="font-weight: bold; color: #333; text-transform: uppercase; "><a href="https://groups.yahoo.com/neo/groups/domaindrivendesign/info;_ylc=X3oDMTJlNjhsNXBxBF9TAzk3MzU5NzE0BGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTQ4OTM4MjEyNw--" style="text-decoration: none;">Visit Your Group</a></span>

     <ul style="list-style-type: none; margin: 0; padding: 0; display: inline;">
            <li style="border-right: 1px solid #000; font-weight: 700; display: inline; padding: 0 5px; margin-left: 0;">
      <span class="cat"><a href="https://groups.yahoo.com/neo/groups/domaindrivendesign/members/all;_ylc=X3oDMTJmNDlrdWY3BF9TAzk3MzU5NzE0BGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzE0ODkzODIxMjc-" style="text-decoration: none;">New Members</a></span>
      <span class="ct" style="color: #ff7900;">3</span>
    </li>
                                              </ul>
  </div>


<div id="ft" style="font-family: Arial; font-size: 11px; margin-top: 5px; padding: 0 2px 0 0; clear: both;">
  <a href="https://groups.yahoo.com/neo;_ylc=X3oDMTJkcGFobWtpBF9TAzk3NDc2NTkwBGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxNDg5MzgyMTI3" style="float: left;"><img src="http://l.yimg.com/ru/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height="15" width="137" alt="Yahoo! Groups" style="border: 0;"/></a>
  <div style="color: #747575; float: right;"> &bull; <a href="https://info.yahoo.com/privacy/us/yahoo/groups/details.html" style="text-decoration: none;">Privacy</a> &bull; <a href="mailto:[email protected]?subject=Unsubscribe" style="text-decoration: none;">Unsubscribe</a> &bull; <a href="https://info.yahoo.com/legal/us/yahoo/utos/terms/" style="text-decoration: none;">Terms of Use</a> </div>
</div>

<!-- |**|end egp html banner|**| -->

  </div> <!-- ygrp-msg -->

   


  <br>

<!-- |**|end egp html banner|**| -->


<div style="color: white; clear: both;"/>__,_._,___</div>
</body>

</html>

--9nlWnTS9ocNmxdhsK3FKVLWiM6a5jwOaA8HvrLV--