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

Refactor Schedule.AddNewAppointment to abide by the CQS principle #47

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

snowfrogdev
Copy link
Contributor

In practice AddNewAppointment is a command method, it has side effects and mutates the object. As such the CQS principle would want the method to not return anything. There isn't a single place in the app where we actually do anything with the returned Appointment. I figure we might as well mark the return as void.

I guess this change also follows the principle of least astonishment. I was 'surprised' to see this method return a value and a bit confused as to why, seeing as we didn't use that value anywhere. 🙂

Copy link
Owner

@ardalis ardalis left a comment

Choose a reason for hiding this comment

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

Sounds good, thanks

@ardalis ardalis merged commit 4c9ae69 into ardalis:main Sep 27, 2022
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.

2 participants