Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input validation consistency #3

Open
dotnetcontributer opened this issue Dec 19, 2023 · 1 comment
Open

Input validation consistency #3

dotnetcontributer opened this issue Dec 19, 2023 · 1 comment

Comments

@dotnetcontributer
Copy link

dotnetcontributer commented Dec 19, 2023

Hi Milan,

Thanks a bunch for this awesome project—it's exactly what I've been searching for!

I'm pretty new to clean architecture and DDD, and I've got a couple of questions about keeping things consistent with input rules, like checking for not null or empty and setting maximum lengths. I'd love to hear your thoughts.

The not null/empty rules are in the Domain layer, but they're also duplicated in the Application layer. So, when I need to change the rules, I have to make updates in two places. There's a risk that a developer might forget to update one of them. Any best practices for solving this?

The max length rules are in the Application layer. Should I also have the same rules in the Domain layer? If not, why do we have not empty rules in both layers? If yes, it brings me back to my first question.

Looking forward to your insights.

Best regards.

@Ebrahem-Outlook
Copy link

Y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants