Main Content

Metaprogramming in the Wild: Source-Diving FactoryGirl

About the Talk

August 10, 2012 11:15 AM

Norris Conference Center, Austin, TX

Norris Conference Center, Austin, TX

Metaprogramming is still an elusive practice of Ruby programmers; Rails 3 helped bring it more into the spotlight but the dynamicism turned a lot of developers off.

FactoryGirl uses metaprogramming heavily in order to support concepts of mixins (for shared traits), inheritance (for parent/child factories), and lazy evaluation (for attributes that refer to each other). In this talk, I cover the various ways to use metaprogramming to help build a good DSL by covering context evaluation, defining methods dynamically, method scoping, and design principles like SRP and OCP to add and extend behavior easily.

Ratings and Recommendations

Avg. Rating

Average based
on 4 ratings

comments powered by Disqus