Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: Need help to build a framework

by einhverfr (Friar)
on Feb 25, 2014 at 08:29 UTC ( #1076106=note: print w/replies, xml ) Need Help??

in reply to Re^2: Need help to build a framework
in thread Need help to build a framework

I did something like this back in 5.6 that required some really funky workarounds. Today I would recommend the following approach (what I did with PGObject's registered type system).

  1. You have a module private (lexically scoped) hash variable connecting an extension to a plugin class name.
  2. You specify an interface for that plugin. We could call it extract_files().
  3. You call it somehow like this:

This approach allows you to add whatever extensions you want and have them register themselves (through an API) which can check for the extract_files interface and add to the registry.

Replies are listed 'Best First'.
Re^4: Need help to build a framework
by (Acolyte) on Feb 25, 2014 at 19:06 UTC

    Thanks einhverfr

    My requirement has changed a bit.Now,the input to the framework is: extracted location of a tar file.

    2.type of Installer technology using which script will crack the binaries and extract the evidences.The evidence can be a filename like (Websphere_Application_Server.swtag) or an installer evidence(i.e the content of a file which tells that Websphere is installed in my machine).

    output of the framework should be an xml file: that reports the file evidences the script finds and the installer evidences the script finds.

    example xml section of a string (Websphere in this case) if found,this is installer evidence using Install Anywhere technology(IA):

    <package name="Websphere Application Server" Evidence="IA" Version="6.0">

    <property publisher="ibm" </property>


    File evidence should be something like this:


    <property Filename="Websphere_Application_server.swtag" size=50 </property>


      The same basic plugin approach works. You could even use dispatch tables if you needed to but I think that complicates things while defined interfaces and registered plugins works better.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1076106]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2018-02-21 19:00 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (287 votes). Check out past polls.