raZ
Is this DDD Specification a good practice or not?
I am aware that you are talking about DDD but i see almost no difference in any specification and ddd.. if we take your implementation i guess the check has access to the DB in order to check the uniqueness i would recommend to extract all the data in the application layer and then just push the aggregate that hold all the data into the specification. That way you are able to run multiple checks together and build some complex business rules in the specification.
6 replies
Is this DDD Specification a good practice or not?
you should only apply the rules on the specification.. do not make the async call in the configure rules. you should only configure the rules and someone else AKA as the repository is executing them.
you can take a look in this repo for examples
https://github.com/dotnet-architecture/eShopOnWeb/tree/main/src/ApplicationCore/Specifications
you can always read some simle examples here:
https://deviq.com/design-patterns/specification-pattern
6 replies