We have all experienced moments when our app does not work as expected: Failing validations, libraries raising exceptions, web services becoming unavailable. When this happens, our code ends up becoming defensive against potential failure and overall quality deteriorates. What if we could simplify the process and model our code as a succession of commands, with only success and error paths?
We'll work to refactor bloated logic. We'll extract and group code into meaningful objects called commands. These commands will then be chained to handle success/failure and pass data.