Chris Pine
Track: Ruby
Date: Thursday, July 10
Time: 4:30pm - 5:15pm
Location: Eugene
In Ruby, where classes are objects, metaclasses are classes, and any object
can have its own singleton class, the general object model is deeper (and
stranger) than it first appears. While, on the surface, it gives us all of
the features of traditional OO languages such as Java, it is in fact a far
more intricate, dynamic, and powerful structure.
However, all of this power comes at a conceptual price, and you can't fully
use what you don't fully understand. This talk will describe the _right_
way think about objects in Ruby: how an object relates to its class, and
how classes and superclasses actually work. In the course of the
discussion, we will see how modules and singleton classes fit into the
framework. We'll also see how the singleton classes of objects differ from
the singleton classes of classes, and why.
Why do you care about all this (after all, you can write perfectly decent
Ruby programs using only standard OO techniques)? Because knowing how all
of this works will enable you to write better programs faster. For example,
sometimes it's overkill to create a singleton class when quickly extending
an object will do. Learn to use all of Ruby's meta-programming
capabilities, capabilities not found in most other languages, to write
dynamic and flexible programs and to code past the conventional OO idioms.