Note that there are some explanatory texts on larger screens.

plurals
  1. PODecoupling technology from domain objects
    primarykey
    data
    text
    <p>My company has an application that allows users to perform a diagnostic medical test that measures circulating blood volume. This test involves using a gamma counter to measure/count the radiation in multiple blood samples. These samples are placed in a motorized carousel (i.e., sample changer) that moves the samples over the gamma counter to be counted.</p> <p>Here’s what we believe our domain nouns are:</p> <ul> <li>Test (i.e., blood volume, quality control)</li> <li>Patient</li> <li>Sample (i.e., something to be counted)</li> <li>Spectrum</li> <li>Test execution context (i.e., specification of the samples and their order that correspond to a certain type of test)</li> </ul> <p>We believe our domain verbs are:</p> <ul> <li>Moving the carousel to a given position</li> <li>Obtaining a spectrum (i.e., counting a sample)</li> <li>Running tests</li> </ul> <p>As we understand domain driven design, the business logic should go in the <em>domain</em>. Our business logic resides mainly with what we’re calling a <em>test execution controller</em>. This controller uses a test execution context to determine how to move the samples into position and to have the gamma counter measure them.</p> <p>The specific technologies that are giving us some confusion are Prism and WCF.</p> <p>(1) Prism relies on an <em>event aggregator</em> to pass non-CLR events around the system. The test execution controller uses this to let other parts of the system know what’s going on (e.g., Sample 2A is being counted, there are 34 minutes remaining for the current test). Technically, the event aggregator is a <em>technology</em> that’s part of Prism, and domain objects/services are not supposed to rely on technology.</p> <p><strong>Question</strong>: Is there a way to restructure things so that our domain service isn’t technology-dependent?</p> <p>(2) We have two WCF services that allow us to communicate with the sample changer and gamma counter. Each service has a contract (i.e., an interface that’s decorated with WCF-specific attributes). At least with the contracts, we separate the concerns such that our main application depends on <em>behavior</em>, rather than a specific sample changer or gamma counter. However, WCF is a <em>technology</em> and the application code needs to know that this service we’re talking to is a WCF service (which is done by creating a proxy class). To satisfy DDD constraints, we end up having several similarly named classes/interfaces that seem redundant. Here’s an example</p> <ul> <li>IGammaCounterService – WCF contract that defines methods to communicate with a gamma counter. This interface is referenced by (1) the WCF side of things where the actual implementation lives, and (2) application code that talks to this service.</li> <li>IGammaCounter – set of properties/methods that defines the behavior for a gamma counter. (This is part of our domain.)</li> <li>GammaCounterProxy – class that implements the WCF service contract. This is what our application uses to communicate with the WCF service.</li> <li>GammaCounter – class that is used by the business logic. This is a GammaCounterProxy (via inheritance) and also implements IGammaCounter. (Note: We use an inversion of control container – specifically Unity – to register this instance within our application.)</li> </ul> <p><strong>Question</strong>: We have interfaces in the domain and on the WCF side that basically have the same method names. Is there a better/cleaner way to do this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload