The stupid question is the question not asked | |
PerlMonks |
Re: subclassing: how to design my moduleby stevieb (Canon) |
on Feb 09, 2018 at 15:11 UTC ( [id://1208838]=note: print w/replies, xml ) | Need Help?? |
Congratulations Discipulus! Without seeing an overview of all the various pieces, it's hard to come up with the best scenario here, so anything I say here is just off the top of my head. In Win32::Event2Log, you could use the Engine as a base class, and in the Engine, you could use (or optionally require at runtime depending on the user's selection). Then, for example, if a user wants a specific "type" (ie. Reader, or wrapper for the binary):
Then, in the constructor above:
In Engine
Very much untested, and again, I'm a bit confused as to how the whole thing ties together, so this is just one example of what can be done here. If you add more functionality in the future, you'd just need to modify Engine, as the Event2Log module simply passes the "type" along as an argument. Engine can take care of managing the actual engines, as it probably should.
In Section
Seekers of Perl Wisdom
|
|