Re: Working with domain events. Referencing leaf / sub-entity of aggregate

"[email protected] [domaindrivendesign]" <[email protected]> 23 May 2016 23:15:19 -0700
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
--9nlWnTS9ocNmxdhsK3FKVLWiM6a5jwOaA8HvrLV
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="UTF-8"

SGksIA0KDQogbWVhbndoaWxlIEkgaGFkIHRoZSBjaGFuY2UgdG8gdGFsayB0byBvdXIgZG9tYWlu
IGV4cGVydCBhbmQgdG8gaGF2ZSBhIHRhbGsgd2l0aCBNYXRoaWFzIFZlcnJhZXMuIFNvbWUgdGhp
bmdzIGJlY2FtZSBtdWNoIGNsZWFyZXIgbm93LCBidXQgSSB3b3VsZCBsaWtlIHRvIGhlYXIgZnJv
bSBvdGhlcnMgd2hhdCB0aGV5IHRoaW5rIGFib3V0Lg0KIA0KDQogV2UgZGlzY3Vzc2VkIHdpdGgg
b3VyIGRvbWFpbiBleHBlcnQgdGhhdCBvdXIgZG9tYWluIG1vZGVsbCBuZWVkIHRvIGxvb2tzIGRp
ZmZlcmVudCB0aGFuIGl0IGlzIGxpa2UuIE91ciBTb2Z0d2FyZSBuZWVkcyBzdXBwb3J0IGZvciBz
b21ldGhpbmcgbGlrZSBhIFByZS1PcmRlci4gV2l0aGluIHRoaXMgUHJlLU9yZGVyIGlzIGRlZmlu
ZWQsIHRoYXQgZS5nLiBjdXN0b21lciB3YW50cyB0byBoYXZlIGEgc3BlY2lmaWMgcXVhbnRpdHkg
d2l0aGluIHRoZSBuZXh0IHllYXIuIFRoYXQgaXMgbm90aGluZyBjb25jcmV0ZSwgYmVjYXVzZSB0
aGUgUHJlLU9yZGVyIHdpbGwgbm90IHRlbGwgeW91IHdoZW4gdG8gZGVsaXZlciB3aGljaCBxdWFu
dGl0eS4NCiANCg0KIFdoZW4gdGhlIFByZS1PcmRlciBiZWNvbWVzIG1vcmUgY29uY3JldGUsIGFu
IG9yZGVyIHdpdGggb25lIG9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lIHJlcXVlc3QgdG8gYW4gb3Jk
ZXIgaXRlbSBoYXMgYmVlbiBmdWxmaWxsZWQuDQogDQoNCiBUaGFuayB5b3UsDQogRmxvcmlhbg0K



--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|**| -->


Hi,<div><br></div><div>meanwhile I had the chance to talk to our domain expert and to have a talk with Mathias Verraes. Some things became much clearer now, but I would like to hear from others what they think about.</div><div><br></div><div>We discussed with our domain expert that our domain modell need to looks different than it is like. Our Software needs support for something like a Pre-Order. Within this Pre-Order is defined, that e.g. customer wants to have a specific quantity within the next year. That is nothing concrete, because the Pre-Order will not tell you when to deliver which quantity.</div><div><br></div><div>When the Pre-Order becomes more concrete, an order with one or more order items will be created - there will be no call-off anymore. An order will be accepted or denie
 d in all. It can not be partly accepted.</div><div><br></div><div>Of course charging warehousing will be a part of the software, too. But I think this is about pricing and not so much about modelling order. The average timespan between an (pre-)order and last item delivered is quite different, depending on our customers. Let&#39;s say two or three month.</div><div><br></div><div>But coming back to my main topic and the reason why I opened the conversation:</div><div>The talk to mathias verraes - thank you again - helped me. But I would like to hear your opinion, whether it is quite clear to you, too. It is about referencing childs of an aggregate.</div><div><br></div><div>I understood Eric Evans and others, that it is not allowed to reference entities from within an aggregate by other en
 tities. Obviously it makes absolutely sense. But what exactly means holding an reference?</div><div><br></div><div>If we publish an event to the whole world of our system when an order item is created. Of course there will be the Id of the order and order item within this message, but not the order item object itself. Is creating an goods issue request in dispatch holding the Id to the order item okay/allowed? To me it is a reference, too, but only the id. By publishing this message a local identity becomes a global identity.&nbsp;</div><div><br></div><div>When a goods issue request is fulfilled there will be a message, too, containing the order and order item id. So an order can be loaded by the id and we can tell the order aggregate that an goods issue request to an order item has been
  fulfilled.</div><div><br></div><div>Thank you,</div><div>Florian</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=24769/stime=1464127123" 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=X3oDMTJldW9mY282BF9TAzk3MzU5NzE0BGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTQ2NDEyNzEyMw--" 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=X3oDMTJmN2tjYWk4BF9TAzk3MzU5NzE0BGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzE0NjQxMjcxMjM-" style="text-decoration: none;">New Members</a></span>
      <span class="ct" style="color: #ff7900;">1</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=X3oDMTJkYThkNmpzBF9TAzk3NDc2NTkwBGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxNDY0MTI3MTIz" 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--