On Monday 12 September 2005 17:06, rubyhacker / gmail.com wrote:
> Randy Kramer wrote:
> 7. And I think: What would a one-to-many databasse relationship look
> like in object terms? So I decide it must correspond to an array
> inside my Foobar object. And it doesn't sound like something I would
> ever really use or see a need for. But to accommodate the case that
> I might use 3% of the time, the syntax for the case I use 97% of
> the time has to become five times nore complex. (Granted, once I
> get into it more deeply, I might be glad to have "one-to-many" and
> use it in ways I don't foresee now.)

class moo
  def initialize
    @1 = Time.now
    @2 = Time.now
  end
end

moo.new

Moo now contains many Time objects.  Throw it at KirbyBase, and you want a one 
to many (which just means that one moo contains many time objects).  There's 
no reason to have multiple Time tables (one for each instance) when they're 
the same fields, no?  You're right, this would usually fall out of an array, 
and it's when you want one to many relationships implemented.  This happens a 
LOT in the real world (at least in my programming style).  Hope this helps 
clear up the 3% to 97% analogy. :-)