Fork me on GitHub

Plug-ins for modules.  Bottom

  • I'm just wondering if anyone has devised a scheme for standardizing plug-ins for standard and third-party modules. I'm asking because I have found a number of occasions when a standard module or a third-party module does 99% of what I need and with just a few dozen lines of code, I can add the functionality that it's missing. But by adding the code straight to the module, I'm changing the module itself, which makes it hard to upgrade and somewhat cumbersome to share.

    I'm currently working on a project that revolves around one fairly large and robust module that I wrote in anticipation of the Cafe Press affiliate program that should be launching within the next few months. To it, I would like to add a whole bunch of functionality down the road, but I'd like to keep it modular, in that the module itself performs its core functions and then plug-ins are used to extend its functionality as desired by the user. I can certainly create my own scheme for the deployment of these plug-ins, but I figured I'd ask if anyone out there has anything they've already cooked up or anything that's on the road to becoming Standard Operating Procedure.

    If something exists, great. If not, is anyone else interested in some sort of a routine that would allow for easy integration of plug-ins inside of modules? If some of you are interested, what are your thoughts on how it should be structured? All I know for sure is that I don't want to write 2 dozen "helper" modules with their own admin interfaces, each with 2 or 3 settings. I want to do something that will add the administrative functions of the plug-ins to the admin interface of the core module. That's my only really big requirement. I'm open to suggestions on everything else.

    - Ed
  • Personally I prefer the helper module approach as it makes a whole lot of things easier. The code is more managable, the code is easier to debug, the code is testable in isoloation. Breaking the module down has advantages for code re-usability. So if the utilitiy side of the module could be useful for other projects then I would recommend making that a module.

    This is a generalisation of course and no one solution will fit all which is why you'll only ever get peoples opinions rather than any concrete recommendations. Give two coders the same problem and you'll get two different solutions.....

    As I say personally I don't like really large modules as I can almost always see somethingthat could be useful in another module and thus would be best as a useful, stand-alone utility module.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Thanks Mark. That's the direction I was going with it, but the problem I'm coming up with is that in this particular application, I'm looking at potentially dozens of these helper modules and any one user might find 7 or 8 of them helpful. If each has its own admin UI, that's a whole lot of clicking around to set things up. And most of these modules won't have a great deal of value without the core module. So, here's what I'm thinking now. If someone could tell me if I'm way off base, I'd appreciate it. I get lost easilly and I could dig into this for a month tearing out what little hair I have left.

    I'm thinking of writing each of these plug-ins as a helper module sans admin interface. Having just recently started exploring the wonder of hooks, I'm thinking it should be possible to use them to integrate the administrative options for the helper modules into the admin area of the main module, at least for those modules that don't have a whole lot of stand-alone value (such as alternative shopping carts for a Cafe Press custom store module). Those few modules that do have stand-alone value (e-card module, reciprocal links, etc.), I'll give their own admin UI because they might be useful independent of the core module of the project.

    Am I headed in a sensible direction or am I going to end up just beating my head against a wall here?

    Thanks in advance,

    Ed
  • 0 users

This list is based on users active over the last 60 minutes.