Hacker News new | ask | show | jobs
by UK-AL 3280 days ago
"presence of sql escape characters" - isn't a business rule. That's technical.

Range acceptance - could defiantly be a business rule. Cross-field consistency - Could also be a business rule.

I implement these rules both sides. Ideally i don't want an invalid command sent off in the first place. I also don't want badly implemented UI corrupting my business data.

This way i can provide instant feedback to the user, and also protect the data in case the UI is badly implemented.

The main point of these architectures is that you can use them from many user interfaces.

1 comments

"I implement these rules both sides" ... and the maintenance overhead?
Still easier than having separate domain models.

Adhering to dry in all cases, is not always the best solution. As the software community has discovered over the past years. Especially in relation to microservices.

In my software there's a bit of a disconnect between the application and interactors. As there is a message queue between them.

This is stuff like there is JavaScript regex that checks for an @ character in an email and in the back end code. There is no reason to not do both.