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. 🙂
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 returnedAppointment
. I figure we might as well mark the return asvoid
.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. 🙂