❔ How to verify data according to DDD, SOLID and Clean Architecture?
I own in two places one IF, it is:
According to the above rules, how not to duplicate the condition? I would like to avoid a problem in the future where we change something in one place and forget the other.
My code:
4 Replies
Model:
I added this to the model:
next:
Does it comply with the above rules?
I think you're over-thinking a trivial
if
statement
DRY doesn't mean "all your business rules will always be centralized and never be repeated, ever"
it's a subjective philosophy about consolidating business logic, when you can
you're spending too much time worrying about nonsense hypotheticals, and not giving future maintainers enough credit if you think that
is not semantically obvious
and it's a fool's errand to try and consolidate everything so that if you make future changes, you don't have to do your dilligence to make sure related code doesn't break
you always need to be doing that dilligence
if you're worried about the effort that's gonna take, you back it up with testing, not try and deduplicate every possible bit of business logicThis doesnt look like ddd
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.