We've all seen monolithic Rails models: pages and pages of methods all dumped into one class. Inevitably, someone starts moving things around just to feel better about the line count, but this doesn't make any real difference to the overall structure of the code. How can we reify actions on an object and simplify our classes?
In this talk I'll speak about using the concept of "middleware" (in the way Rack uses "middleware") as a general purpose abstraction for improving the organization, testability, and maintainability of complex pieces of code. I'll talk about my first hand experience of using middleware to power Vagrant (http://vagrantup.com), and we'll use these ideas to simplify an existing application.