Join B'more on Rails

You'll get invited to our Meetups as soon as they're scheduled!

B'more on Rails December Meetup- Presenter Classes: Making the Most of Your Data

Dec 2007 11
Tue 7:00 PM
Location
This location is shown only to members
Estimated attendance
 17  people attended.
5.00 5.002

December Meeting:

Presenter: Mike Subelsky

Here is what Mike says about his presentation
Presenter Classes: Making the Most of Your Data with the Best of Ruby
I will begin with a review of Presenter classes and a quick example
of a simple Presenter used to handle signup in a real-world web
application, where signup involves creating two different objects
which must both be validated before either can be created.
I will contrast this approach with the one commonly presented in
Rails blogs and in AWDWR: using transaction blocks in the controller
to determine which model gets saved when, only if both validate
successfully. I will show that Presenters are easier to understand
and test than the controller-based approach.
I will then discuss how Presenter classes can be used to make
database queries more powerful and expressive by marrying the
strengths of Ruby with the strengths of SQL. Presenters can generate
SQL statements in a way that is DRY, readable, maintainable, and
easily tested.
I will demonstrate a real-world example from a high-volume consumer
web application currently in alpha-testing, showing how Presenters
build complex SQL queries one fragment at a time, seamlessly and
rapidly joining six tables together in one consolidated view. Using
this technique resulted in a 12X speed reduction in database access
time.
I will conclude by briefly discussing the details of Presenter
implementation, using the Forwardable library and some custom
techniques I've developed to make Presenters easier to write.

Photos of this Meetup

No photos yet.

Talk about this Meetup

You must be a member to post a comment. Join or login.

Who attended?