Mark Fuller wrote:
No. It's my $self, right? So, I can make any assumptions about how *I*
implement myself, right? I subclassed C::A and I don't want to collide (or
*access*) any of *its* variables. I can understand C::A making me use a
setter/getter method to access *its* variables. But, why do I have to use
one to access *my* variables?
That's what I'm driving at. It may be good practice for me to use
setter/getter methods for my own variables. But, why should C::A force me to
use its method?
This is the problem. It's not your $self. You didn't bless it into being
an object.
Technically the $self is owned by whoever blessed it. So, since you are
*inheriting* from C::A and assuming you aren't sub-class it's new()
method, then C::A owns $self.
Inheritance is the key. You do not simple "use" C::A in your packages,
you inherit ( use base ) from it, thus, you are expected to abide by the
ground-rules set out by the parent class, anything less and you risk
your application breaking in the future when you upgrade.
If you are creating your own objects with your own new() methods that
are blessing objects into existence, then you can control $self however
you want, but Andrew was right, $self may not be a hash, it could be an
array, and it could be something very different in Perl 6.
--
Steve Comrie
---------------------------------------------------------------------
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]