From: "Richard Dice" <[EMAIL PROTECTED]>
> In almost any other mainstream language other than
> Perl no-one would ever want to try to do what you want, nor would they
even
> *contemplate* being able to do this, because the underlying implementation
is so
> opaque to derived classes that there's basically no way to get at the
underlying
> data structure.

Thanks Richard. What I was trying to get at is why can't an object I am
subclassing (like C::A) give me a contract for accessing its methods and
variables. But, let me use $self any way I want (since I'm extending that
base)?

Here's another way I'm seeing it: I can't access $self to store my own
variables (I have to use "param"). But, I can define my own methods and call
them as $self->method_name(). Now, why can I freely extend the base object
this way (without going through a mechanism provided by the base object)?
But, I can't do it when it involves instance variables? Is this just a
matter of how Perl works? Perl accomodates adding methods? But not
variables?

I wish I understood OO better. It just seems like there should be a way to
add my own instance variables to self without being so dependent upon the
base object *similar* to how I can add my own methods. Or, are you going to
tell me I shouldn't add my own methods either?

Thanks,
Mark


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to