Rack Middleware as a General Purpose Abstraction
summary
Argues that Rack middleware can be a general-purpose object-composition primitive: move large methods into small classes with a call(env) convention, extract dependencies (user from env), and chain operations. Shows Vagrant’s middleware stack (validate → check_accessible → suspend/create) as a working example and refactors a Diaspora user accept_invitation into a middleware-style class. Results: easier reuse across commands, simpler unit tests, clearer dependencies, and practical success in both Vagrant and the refactored app.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:55What is this talk about
- 1:30Existing solutions
- 2:11Object composition
- 3:16Survey
- 3:49Review
- 4:22Middleware
- 7:31Endpoints
- 8:08Questions
- 9:06Virtual Machines
- 9:30vagrant
- 10:13invocation
- 10:42virtualbox
- 11:39I have nothing
- 12:26Rails developers
- 14:08Dependencies
- 17:01Controller
- 18:47Refactoring
- 19:26Significance
- 19:36Mixins
- 20:05Methods
related talks
33mRack Middleware as a General Purpose Abstraction
28mIn a World of Middleware, Who Needs Monolithic Applications
30mThe Power of Middleware - Building Your Own Mini Web Framework on Rack
28mRack for web developers
27mHarness the power of functions to build composable rack applications
41mRack - A Framework to Roll Your Own
38mRewriting Rack: A Functional Approach
55mThe Future of Rack
