Good Advice: Hook Don’t Hack
The gentlepeople at Made By Hippo shared how they approach extending add-ons that don’t do exactly what they need:
[W]e have started adding custom hooks into existing addons and points in the code that we need to inject our functionality. Not only does this abstract the custom logic away from the core add-on, but it means you’re looking at 2-3 lines of code when it comes to upgrading the add-on for future releases.
Rather than hacking at the code, they just give themselves a place to inject their own code. Still a hack but cleaner because it’s easier to update.
Great write-up. Read the entire article for all the information, including code samples to get you started.
Brian — 09:55 on 08.31.2012
Be sure to send these sorts of changes to the add-on developer explaining why you needed the hook. If its a good or common use case, then hopefully it will get added to the official release, then you don’t have to hack anymore if you upgrade.