Domain modelling and ActiveRecords

Hi all,

I am wondering if this could be a good idea to support the Object#extend
method for an ActiveRecord class.

Let’s say I have a customer (with a corresponding customer table in the
DB). At one point, this customer becomes a “BillableCustomer” (with data
in another table for billing information).

Wouldn’t it be nice to write:

customer.billingAddress = …

This way, you could implement Actor-Role patterns without the necessity
to create 2 classes representing the same logical object and an
association between the 2.

What do you think? Have you ever encountered that need? How did you deal
with it?



Eric T.
LTG - Product Manager
tel: 33(0)
e-mail: [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs