----- Original Message ----- 
From: "Tom Sawyer" <transami / transami.net>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Saturday, July 06, 2002 1:08 PM
Subject: to pass or to be?


> so i have a question realted to class inheritence: when a class inherits
> from a superclass, is it good coding practice for the superclass to use
> the childs instance variables? or should they be passed? for example:

I suggest:
 
 class A
  def initialize(x)
    @x = x
    puts x
  end
end
 
 class B < A
  def initialize
    super("hello world!")
  end
end
 
> i don't know why but i tend feel like its cool for the subclass to look
> up at the superclass, but not for the superclass to look down. it just
> seems funny, but i can place why. so i'm wondering what others think.

I agree. It increases the coupling, for one thing.

Hal Fulton