in reply to Dynamic loading of object-oriented plugins

Check out Re: Re (tilly) 1: Stopgap measures when you don't have a QA department, it demonstrates a little registration sub for packages that uses caller instead of passing the package name. I've used this strategy sucessfully in the past. Just be careful if you are using mod_perl and STAT_INC, when the GateKeeper (central registration point) module reloads, it will forget all the packages that have registered up to that point.

Now for the fun part, you can have multiple stragegies for figuring out which modules to load. You could have a basic static list, a run-time user interface, and do a foreach on a readdir, requiring all modules in the puglins/ directory.

This is a great base for a Factory class or a list of arbitrary handlers.

-jackdied

  • Comment on Re: Dynamic loading of object-oriented plugins