Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I spent some time wondering why the driver config files weren't simply set up as modules subclassing the more general categories of interface and protocol layer

Well, if I understand what you mean here, I think the answer is that drivers in OpenPlugin typically *are* subclasses of more generic Plugin modules, and Class::Factory helps me do that.

Class::Factory is about being able to load/use classes dynamicly. So even with having the drivers as subclasses, we still don't necessarily want to load every plugin or driver at once. There are cases though when we would want to load a plugin or driver at load time, and Class::Factory accommodates us there too.

Each plugin uses Class::Factory as a base class (actually, more technically, each Plugin uses OpenPlugin::Plugin as a base class, and then OpenPlugin::Plugin uses Class::Factory as it's own base class). Class::Factory then provides a consistant method for loading each plugin via it's new() constructor. So, new() is part of Class::Factory, but inside that constructor is a call to init(). A plugin or driver may implement init() if it wants to do any custom initialization stuff.

I'll have to take a look at POE to see how they're working things.

Thanks for your thoughts,
-Eric


--
Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
Schroeder: "The joy is in the playing."

In reply to Re: Re: Request For Comment: Web Application Plugin Manager by andreychek
in thread Request For Comment: Web Application Plugin Manager by andreychek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-03-28 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found