Bobcat has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, fellow Monks!
I've been through the Object Oriented stuff here, but can't seem to locate anything that relates to my current situation. I am trying to create some process logging classes for a web application at work. The basic structure is this:
BaseClass.pm | +-> Log.pm | +-> Writer.pm +-> Reader.pm
The Log.pm class (BaseClass::Log) inherits some general configuration stuff, a Database handle and other little things needed for the application. The Log.pm contains the functions that would be shared between the Reader (BaseClass::Log::Reader) and Writer (BaseClass::Log::Writer); namely primary key lookup functions and the like. The Writer.pm and Reader.pm contain only the methods necessary to write and read from the log tables.
The Log.pm has an @ISA=qw(BaseClass); Reader.pm and Writer.pm both have @ISA=qw(BaseClass::Log). The object is being blessed (2 argument) in the BaseClass.pm file, and all subsequent modules make a call to $class->SUPER::new.
Everything seems to work fine for the first creation (Writer to Log), but upon calling $class->SUPER::new from the Log object, the class still reads "BaseClass::Log::Writer".
What am I doing wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Objects and Inheritance
by Ovid (Cardinal) on Nov 21, 2001 at 04:54 UTC | |
|
Re: Objects and Inheritance
by Bobcat (Scribe) on Nov 21, 2001 at 05:01 UTC | |
by Ovid (Cardinal) on Nov 21, 2001 at 05:20 UTC | |
by Bobcat (Scribe) on Nov 21, 2001 at 05:32 UTC | |
by runrig (Abbot) on Nov 21, 2001 at 05:21 UTC | |
|
Re: Objects and Inheritance
by Bobcat (Scribe) on Nov 21, 2001 at 05:35 UTC | |
by perrin (Chancellor) on Nov 21, 2001 at 19:34 UTC | |
|
Re: Objects and Inheritance
by perrin (Chancellor) on Nov 21, 2001 at 04:48 UTC |