That's Not My Job!

posted by andy, Mon Apr 20 14:22:00 UTC 2009

Methods of Delegation with Ruby and ActiveRecord

What do you do when your data domain is well-factored but just isn't 'convenient'? For example, suppose you create a data model in which both a Person and a Building have an Address and you've pulled out a ZipCode class so that you can prompt your user to select from a list of previously known city/state pairs. Do you compromise your award winning data model and repeat (gasp!) data? Do you provide a series of convenience methods? No! Teach your objects (and maybe yourself) to delegate.

In this talk we'll look at ways that ActiveRecord simplifies delegation and how you can take advantage of Ruby to build similar delegation in non-ActiveRecord classes.

Meeting: Tuesday April 28 at High Noon

Check here for directions if you have not joined us before.

Filed Under: Meetings | Tags:

Comments