Tom Sawyer <transami / transami.net> writes:

> > If a superclass accesses its child's instance variables, then by
> > definition all children must have that variable (or the thing will
> > break). Therefore the variable should be factored into the parent
> > class.

> so your saying i should pass the variables?

That fact that you have a parent class intimately tied to its
children's implementations should be setting off alarm bells.

So, I'd revisit the design, asking myself "why do I have to be poking
around in my child classes this way". I'd then look to factor out the
common functionality up into the parent class, making it independent
of its children.


Cheers


Dave