I’ve been playing around with EdgeRails and checking out some of the
new features. The one that will probably have the biggest affect on
my designs is join models (or :through associations). For those not
familiar with this feature, it lets you replace your habtm
association with a pair of has_many associations indirected through
an intermediate model class.
Looks like good stuff. The thing that makes me cry is trying to name
the darn join model classes. In his Pursuit Of Beauty presentation,
DHH uses the example of an Authorship join model class to represent
the association of an Author and a Book, and a Tagging for a Taggable
and a Tag. Those examples are fairly readable, but I’m noticing that
many other relationships are harder to name. I think the problem is
trying to turn a verb-type relationship into a noun-type reification
of that relationship.
For example, what do you call the reification of the relationship of
a Participant to a Meeting? A “Participation”? An “Attendance”?
What about a Student to a SchoolClass? A ProjectManager to a
Project? Start pluralizing and things get even uglier. Naked join
tables have their drawbacks, but at least they are easy to name.
I suppose I could name a class ParticipantEventJoin to get a table
participant_event_joins. While that would make things very obvious
it lacks a certain charm. Maybe there is a better formula for coming
up with a standard name. Any ideas?
–joshua susser