DRY and cross domain logic

"Tom Eugelink [email protected] [domaindrivendesign]" <[email protected]> Fri, 22 May 2015 14:31:11 +0200
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
We have a discussion in my current project group about the following:
- There are two bounded context.
- In each bounded context there is an person-alike entity, in one BC it is Client in the other it is Patient, mostly with their own business logic and methods specific to their roles.
- However, at some point Patient requires some determining logic that is implemented in Client. For simplicity let's assume both have a date-of-birth and the to-be-called logic is calculateAge().

This is not something that can be done with events, and because of DRY you do not want to implement calculateAge() twice. What is the best option to calculate the age of a patient? Client and Patient share a unique id, so Patient knows which Client to get. (N.B. I seek a conceptual solution, not one specific to the calculate age problem.)

Tom



------------------------------------
Posted by: Tom Eugelink <[email protected]>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/domaindrivendesign/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/domaindrivendesign/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/