Closed jorge07 closed 5 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/Domain/Shared/Specification/AbstractSpecification.php | 0 | 1 | 0.0% | ||
src/Infrastructure/User/Specification/UniqueEmailSpecification.php | 7 | 8 | 87.5% | ||
<!-- | Total: | 16 | 18 | 88.89% | --> |
Totals | |
---|---|
Change from base Build 296: | -0.3% |
Covered Lines: | 509 |
Relevant Lines: | 534 |
Hi, checking uniqueness requirement in the handler is better (aggregate stay pure) in my opinion.
I have some doubt (theoretical) about implementation, I think 'UniqueEmailSpecification' is a normal domain service (change name in CheckUniqueEmail) if we use term "specification" should adhere at "specification "specification pattern" only 1 interface "SpecificationInterface" and UniqueEmailSpecification and other future specification class inherit from this interface. changing contract/interface broke the composition/chaining capabilities of this pattern.
Suggestion1: change the name of service, avoid confusion of the term 'specification'
Suggestion2: don't change the name but change the code and adhere to the pattern
Hey @zerai thanks for your feedback.
Specification abstraction added 👍
I keep uniqueness logic in the domain because is a requirement of the domain itself and IMO business rules when deeper, better.
Fixes #96