When given a foreign class inheritance, why doesn't this code segment push that class name onto the @ISA array?
When given a foreign class inheritance, why doesn't this code segment push that class name onto the @ISA array?
I have an inside out class IOC that ISA PVC class. PVC in a pure virtual class and therefore a foreign class. Within the IOC package, I have the ...
When I use IOC and print out it's @ISA array, PVC is not there. I looked at the Object::InsideOut code that mutates @ISA. I thought it should push inherited foreign class onto @ISA. What should I do to get PVC onto the @ISA array?
EarlSince my understanding of inheritance in Perl is based on using @ISA, I am confused. In an object method invokation, how does an IOC object inherit the PVC methods/subroutines?
The Object::InsideOut section on Foreign class inheritance says ...
One method of declaring foreign class inheritance is to add the class name to the Object::InsideOut declaration inside your package:
This allows you to access the foreign class's static (i.e., class) methods from your own class. For example, suppose Foreign::Class has a class method called foo. With the above, you can access that method using My::Class->foo() instead.
What about the foreign class's object methods? IMHO, the @ISA array is central to how inheritance works. If the class name is not in the @ISA array, I worry that IOC won't be able to inherit the PVC's methods.
I just want to say that I REALLY, REALLY like this module. It's amazing. I'm impressed that there is support for foreign classes. And I'm trying not be negative.
Having said that, what are the consequences of just doing a "use base" to get the modules on the @ISA array? Would this break the Object::InsideOut module?
My pure virtual class PVC doesn't have a "new" subroutine. A pure virtual class just provides a list of subroutines that all subclasses should implement. Furthermore, PVC doesn't make any commitment to the representation of the blessed object. You could have an inside out subclass and a hash-based subclass that are PVCs. Likewise, it doesn't make sense to create an object from a pure virtual class, because the subroutines are not implemented. See the Class::Virtual module.
Earl