I'm currently planing/writing a .8 module, that should be expendable by other module developers, to make the content of their modules available to my module.
What I have problems with, is to choose a good way on how my module can communicate with other modules. Currently I have two ideas. The first one would be to use a own API for it. So the News module for example would create a file called pnextendapi.php and define an info() function like this: function News_extendapi_info(). My module could then call that function via pnModAPIFunc ('News','extendapi','info',array()).
The other possibility I thought of would be , to make the other modules implement a Class with certain functions, that my module could then load via loadClassFromModule(). The problem with this, is that I do not yet understand that objectLib stuff completely. Is it right, that module class has to be extended from PNObject? And if so, would it be enough if my module implements a template class, from which the third party modules need to be extended?
For example:
class myModulesClass extends PNObject
and a third-party module would use
class thirPartyClass extends myModulesClass
I'm not sure although, if that isn't a "misuse" of the PNObjectLib
Anyway: Those are the two solutions I cam up with. What do you guys think? Which of the two would be the best/fastest (in terms of runtime)? Maybe I missed another possibility?
Thanks for any answers!
-Martin
--
Linux is like a Wigwam, no Gates, no Windows and an Apache inside!
