On Tuesday, November 20, 2012 1:34:23 AM UTC-6, Jayapandian Ponraj wrote:
I have a node(b) inheriting another node(a). node(a) includes a class(c)
which inturn inherits class(d). I need to access the variable defined in
node (b) from class (d). I am not sure if its possible.... As far as i know
the node scope ends at node (a)....Wat ll be the fully qualified name for
the variable in node(b)... My original question does not describe the
problem well, ignore it.
Node variables do not have qualified names. If they are not accessible via
unqualified names in the local scope then they are not accessible at all.
On the other hand, in a node inheritance situation, the node variables of
the parent node should be visible as node variables of the child node.
On the third hand, it is unwise to use node variables to modulate the
behavior of your classes. I recommend you avoid that. There are a number
of alternatives, but I can't recommend a particular one for your case with
the limited information available to me.
Also, be very careful about class inheritance. It probably doesn't do what
you think it does, and it is rarely the best solution to a problem. It's
key and defining feature is the ability of subclasses to override
parameters of resources declared by their superclasses. If your reason for
subclassing does not center on that feature then you do not need or want to
subclass. If the superclass is parametrized then you almost certainly do
not want to subclass. Until you understand what I have just written, you
definitely do not want to subclass.