Consuming complex calculation in another Bounded Context

"[email protected] [domaindrivendesign]" <[email protected]> 14 Nov 2017 09:05:16 +0000
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
--9nlWnTS9ocNmxdhsK3FKVLWiM6a5jwOaA8HvrLV
Content-Type:  text/plain;  charset=utf-8 
Content-Transfer-Encoding: base64

SGkNCiANCg0KIEkgaGF2ZSB0d28gYm91bmRlZCBjb250ZXh0cyBTY2hlZHVsaW5nIGFuZCBW
YWNhdGlvbi4NCiBJbiBTY2hlZHVsaW5nIHdvcmtlcnMgY2FuIGhhdmUgc2hpZnRzIGluY2x1
ZGluZyBicmVha3MsIGJhc2VkIG9uIGJyZWFrIHJ1bGVzLg0KIFNvbWUgdGltZXMgYnJlYWtz
IGFyZSBvdmVybGFwcGluZywgc28gYSBzZXJ2aWNlIGV4aXN0cyB0aGF0IGNhbiBjYWxjdWxh
dGUgdGhlIGVmZmVjdGl2ZSBicmVhayBkdXJhdGlvbiBvbiBhIHNoaWZ0Lg0KIA0KDQogaW4g
dmFjYXRpb24gdGhlIGNvc3QgaW4gaG91cnMgb2YgdmFjYXRpb24gY2FuIGJlIGNhbGN1bGF0
ZWQgYmFzZWQgb24gdGhlIHBsYW5uZWQgc2hpZnRzIGZvciBhbiBlbXBsb3llZS4NCiANCg0K
IFNvIFZhY2F0aW9uIG5lZWRzIHRvIHBlcmZvcm0gdGhlIHNhbWUgY2FsY3VsYXRpb24gaW1w
bGVtZW50ZWQgaW4gU2NoZWR1bGluZy4NCiANCg0KIFRoZXJlIGNvdWxkIGJlIHNldmVyYWwg
d2F5cyB0byBpbnRlZ3JhdGUgdGhpcy4gKE9wZW4gSG9zdCBTZXJ2aWNlLCBTaGFyZWQgS2Vy
bmVsIHBsdXMgbW9yZSkNCiANCg0KIEkgdGhpbmsgU2NoZWR1bGluZyBpcyB0byBiaWcgYW5k
IGNoYW5nZXMgdG8gbXVjaCB0byBtYWtlIGl0IGEgc2hhcmVkIGtlcm5lbC4NCiBP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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|**| -->


<p><span>Hi</span></p><p><span><br></span></p><p><span>I have two bounded contexts <span style="font-weight:bold;">Scheduling</span> and <span style="font-weight:bold;">Vacation</span>.</span></p><p><span>In Scheduling <span style="font-weight:bold;">workers</span> can have <span style="font-weight:bold;">shifts</span> including <span style="font-weight:bold;">breaks</span>, based on break rules.</span></p><p><span>Some times breaks are overlapping, so a service exists that can calculate the effective break duration on a shift.</span></p><p><span><br></span></p><p><span>in vacation the cost in hours of vacation can be calculated based on the planned shifts for an employee.</span></p><p><span><br></span></p><p><span>So Vacation needs to perform the same calculation implemented in Scheduling
 .</span></p><p><span><br></span></p><p><span>There could be several ways to integrate this. (Open Host Service, Shared Kernel plus more)</span></p><p><span><br></span></p><p>I think Scheduling is to big and changes to much to make it a shared kernel.</p><p>Open host service seems good, but what if I want to make an in process call to that calculation? And what if scheduling service is down ?</p><p><br></p><p>I could also merge the BC&#39;s since it seems that they need the same information knowledge about shifts and breaks. I just think the same problem goes for other contexts and the scheduling context will end up being one big monolith containing Vacation and other sub domains. (salary being one).</p><p><br></p><p>Whats your experience and recommendation with compile time dependencies 
 on upstream domains?</p><p><br></p><p>Do you still only expose service through ports and adapters layer, or do you make calls into the Application layer (maybe sending message via a message bus) or even into the core domain layer?</p><p><br></p><p><br></p><p><br></p>



<!-- |**|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=24836/stime=1510650317" 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=X3oDMTJlcnAyYWNoBF9TAzk3MzU5NzE0BGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTUxMDY1MDMxNw--" style="text-decoration: none;">Visit Your Group</a></span>

     <ul style="list-style-type: none; margin: 0; padding: 0; display: inline;">
                                                    </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=X3oDMTJkMGdvanE2BF9TAzk3NDc2NTkwBGdycElkAzgxMTY5MjMEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxNTEwNjUwMzE3" 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--