1) copy the folder /preloads to your module and change the name of the class in core.php
2) split each class in your /class folder into Class and ClassHandler. For example, if you have a file 'items.php' with a class called Item and ItemHandler in a module called Bingo:
add on top of the original class (Bingo is the name of the module's directory, with first letter in CAPS)
rename the file to Item.php
duplicate the file to ItemHandler.php
in Item.php remove the ItemHandler code
in ItemHandler.php remove the Item code
3) add Helper.php class for consistency we call the class "Helper" and the variable $helper in all modules. Because it will be in namespace, we'll know exactly from which module it is coming from during debugging, so there is no need anymore to call it after the module, e.g. $publisher, etc.
4) replace all instantiation calls to the ItemHandler classes using XOOPS to call directly as
or using the Helper, which is the preferred way, e.g.:
1) standardization of the modules, i.e. standard classes are in /class/Common folder, so I can just copy them to each module I'm working on, and be done with it.
2) common class and function names for the same classes and functions/methods, incl. PSR standards. That's why instance of Helper class should be $helper, and instance of a Handler class should be $classHandler and not the old $class_handler or some other names
3) We might also standardize on using the "reverse Hungarian notation" for variable, like:
to see right away what I'm dealing with, i.e. an object or an array, but if we completely switch to PHP7 and use strong typing, the need for it might go away.