Presenter Classes and the Power of Abstraction
Location: D134 Level: Novice
Moderated by Mike Subelsky, Otherinbox
This talk will use three examples from a consumer-facing Rails application, OtherInbox.com, a Rails app that helps consumers deal with email overload:
1) Writing complex SQL statements to speed up database access, by marrying the strengths of Ruby with the strengths of SQL. Developers can use Presenters to generate SQL statements in a way that isDRY, readable, maintainable, and easily tested, while keeping their models free of clutter.
2) Designing web views that manipulate multiple models simultaneously (where signup involves creating multiple different objects which must both be validated before either can be created).
3) Building complex reports that can accept a wide variety of options to control the scope of the report.
The talk will conclude with a discussion of the details of Presenter implementation, using the Forwardable library and some custom techniques I’ve developed to make Presenters easier to write.