Skip to content

Conversation

aminsharifi
Copy link
Contributor

If it's good practice, may I do the same for the rest of the project's setters?

Copy link
Collaborator

@KyleMcMaster KyleMcMaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just curious as I try to understand the changes being proposed here. How does the KISS principle apply to having SetSomeProperty methods (potentially many methods if you're doing them individually)? Doesn't introducing setter methods make the Constructor, which itself is a setter, more complex?

@aminsharifi
Copy link
Contributor Author

I'm just curious as I try to understand the changes being proposed here. How does the KISS principle apply to having SetSomeProperty methods (potentially many methods if you're doing them individually)? Doesn't introducing setter methods make the Constructor, which itself is a setter, more complex?

Hello Kyle,
Thanks for your review
I wanted to bring to your attention that three commits have been made with the intention of following the KISS, DRY, and CQRS principles. Regarding the first commit you mentioned, I agree that it may not fully adhere to the KISS principle, but it does demonstrate the DRY principle. Specifically, the line Guard.Against.NullOrEmpty(name, nameof(name)) appears to be duplicated in both the constructor and the UpdateName method.

@ardalis
Copy link
Owner

ardalis commented Oct 3, 2024

I'm going to pull these in for now. My goal regarding checking Name in multiple places is to fix that using a Value Object rather than using a primitive, and then the check will live in the Value Object (only). But this will work for now and overall the other changes are helpful.

@ardalis ardalis merged commit 2489749 into ardalis:main Oct 3, 2024
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

Successfully merging this pull request may close these issues.

4 participants