Search code examples
dictionarydomain-driven-design

DDD strategic design vs global dictionaries


Do global dictionaries like countries (codes/names) or currencies (code/names) belong to certain domain in DDD or may be shared as common lib/seperate module of application layer?

From one side DDD requires to keep all business stuff in given domain. From the other side countries/currencies are all the same in each of them.


Solution

  • Chapter 15 (Distillation) of Evans - Domain Driven Design is probably the reference you want.

    Evans uses Generic Subdomain for those areas that are essential to the functioning of the system but are not the specialties that are your primary focus.

    Currencies, Time Zones, Location Codes...

    Evans's guidance is:

    Identify cohesive subdomains that are not the motivation for your project. Factor out generic models of these subdomains and place them in separate MODULES. Leave no trace of your specialties in them.

    ....consider off-the-shelf solutions or published models for these GENERIC SUBDOMAINS.