Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: subclassing: how to design my module

by Anonymous Monk
on Feb 11, 2018 at 03:14 UTC ( [id://1208940]=note: print w/replies, xml ) Need Help??


in reply to subclassing: how to design my module

Engine is a stop word :) its like using "Wheel" or program/module...

Subclassing not required or beneficial as there are only 2 things that read event logs, win32api and win32exe

Win32::EventsFilter Win32::EventsFilter::EventLog Win32::EventsFilter::Wevtutil Win32::Events Win32::Events::EventLog Win32::Events::Wevtutil Win32::Evt Win32::Evt::EventLog Win32::Evt::Wevtutil sub Win32::Evt::start { ... } sub Win32::Evt::EventLog::Last { ... } sub Win32::Evt::Wevtutil::Last { ... } sub Win32::Evt::EventLog::GetNth { ... } sub Win32::Evt::Wevtutil::GetNth { ... }

Ok, if you really wanna gotta subclass, do it without inheritance, and with style (the name not the noises)

package Win32::Evt::Darllenydd; use Moo::Role; requires 'Last', 'GetNth', ...; no Moo::Role; package Win32::Evt::EventLog; use Moo; with 'Win32::Evt::Darllenydd'; sub Win32::Evt::EventLog::Last { ... } sub Win32::Evt::EventLog::GetNth { ... } no Moo; ...

ok ok, if you really really want inheritance

use parent 'Win32::Evt::Darllenydd'; ... package Win32::Evt::Darllenydd; use Carp(); sub Last { Carp::croak( "Last unimplemented" ); } sub GetNth{ Carp::croak( "GetNth unimplemented" ); } ...

 

Hmm vanity .... delicious

Win32::DiEvt Win32::DiEvt::EventLog Win32::DiEvt::Wevtutil

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1208940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found