Closed mayerraphael closed 1 year ago
It's true DDD shouldn't care about infrastructure, and you'll find there are no external dependencies (to out-of-process systems, etc) in the SharedKernel. You could argue that things like common base classes and utilities might be better off in a differently-named but similarly-consumed library, but I've never seen any value in doing so. In my experience the number of actual domain model types that should be shared between bounded contexts is vanishingly small - maybe a common User class for instance. So having just that 0-2 types in one library and then having a separate library with the base types, etc. seems like overkill. Hence, just the one library.
thanks for your opinion.
From the original documentation:
SharedKernel is about sharing a domain models across bounded context. Not about sharing infrastructure code. The shared kernel in this project is rather a Common/Core and has nothing to do with Domain Driven Design. DDD does not care about infrastructure.
I know people have many different opinions on this topic, thanks to the vagueness of the original source. Still, a dependency to MediatR and other infrastructure libraries in the SharedKernel project seems wrong.