Structuring your application flow with command chains
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.
Benjamin Roth
Benjamin Roth is a Ruby and Javascript developer. Much involved in stackoverflow (#2 all time on rails tag), he is also a maintainer of Ruby gems and an instructor on egghead.io. Apart from his passion for family & technology, he is a huge fan of the Calvin and Hobbes comics, even though he does not speak to imaginary tigers... yet!