in reply to Re: Inherited Object Constructor Question
in thread Inherited Object Constructor Question
This solution is so simple, I had to laugh out loud. My co-worker thought I was nuts until I showed him your reply. It wasn't immediately obvious, but having seen the solution it is a definite /facepalm moment.
To answer your question, I'm not using Moose because I hadn't considered it, this is primarily due to my lack of understanding of Moose. Looking at the module for Moose::Manual::Roles I can see what you are saying, but I'm not if it becomes more clear. As a sysadmin the majority of my programming is functional, I'm relatively new to OO Perl and OO Design.
I guess my biggest issue is I am not sure how to load my "plugins" with moose.
As far as naming goes, how is SNMPMonitor::Plugin::MySQL_Monitor not a subclass of SNMPMonitor? (I grant you ATest is not really a subclass of anything, but I don't use Foo::Bar for testing by default). That is, each Plugin will have its own methods that are independent of each other, but they will eventually a return a value to the engine (test.pl, due to be renamed).
That being said, perhaps it would be more clear if all of the constructors and similar methods were in SNMPMonitor/Plugin.pm? since SNMPMonitor represents the entire SNMPMoitor framework?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inherited Object Constructor Question
by chromatic (Archbishop) on Sep 12, 2011 at 04:47 UTC | |
|
Re^3: Inherited Object Constructor Question
by Arunbear (Prior) on Sep 13, 2011 at 14:05 UTC |