Hard Edges: Practical Domain-Driven Design using C# by Eben Roux

Hard Edges: Practical Domain-Driven Design using C# by Eben Roux

Author:Eben Roux [Roux, Eben]
Language: eng
Format: azw3
Published: 2017-10-25T04:00:00+00:00


The relationship is now more clear and we can see that we are dealing with only a reference to a customer. Had we stored only the CustomerId that too would suffice but there is nothing preventing us from denormalizing the customer's name into the order.

Invariants

We should be adding all the required invariants into our domain model. Some rules may require configurable values and these we can pass in when performing the relevant command. An Aggregate Root cannot do much about factors external to the domain model and you should be cognizant of this fact so that you do not attempt to place every requirement into your domain model. Some invariants may seem as though they belong in your Bounded Context but ensure that you are not trying to implement an invariant in the wrong Bounded Context.

An example of an external requirement is authorization. I tend to think about a domain model in terms of a physical calculator. It has a keypad with digits, some operators, and a display. If I decide that I want to secure my calculator, I cannot expect my calculator to do so. Anyone gaining access to my calculator can start performing operations provided by the domain model.

Your domain model should be focused on implementing the business requirements and not any infrastructure, security, performance, or other requirements. If it can aid in achieving these external requirements, then that is first prize but it should be providing deterministic business functionality in a reliable way.

Any integration layer interacting with the domain has the responsibility to ensure that only authorised actions are permitted.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.