Development guidelines

From Organic Design wiki
Revision as of 13:50, 27 May 2015 by Nad (talk | contribs) (make a start)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This document is for developers getting getting on board with an Organic Design project, or working with Organic Design on a client project. Nearly all of our projects are MediaWiki-based projects, and we like to adhere strictly to the general MediaWiki coding conventions and to the language-specific conventions such as Coding conventions/PHP. But apart from these conventions we also have a number of important points concerning the general methodology of working on a project.

Code-base hacks

Probably the most important point to raise is about code-base hacks. This is where in the process of working on a feature or bug-fix, the developer decides to modify the code in a third-party extension, or in the MediaWiki code-base itself.

This is extremely bad form and should be avoided at all costs! Once a code-base hack has been made, it means that this code is no longer able to be updated without re-implementing the code-base hack again. This means that details about the hack must be added to the upgrade procedure and the hack will need to be tested every time and perhaps modified depending on what changes have been made to the third-party code. In practice such a rigorous procedure is never followed and so either the code breaks on upgrade, or the upgrade of that code is avoided and it no longer benefits from the new features of security updates from the authors.

When the functionality of third-party code is required, you can usually achieve it using the hooks provided in the code, or if there are none provided for your requirements, you can write another extensions that overrides the third-party extension's instances at run-time. This latter approach can require ongoing maintenance, but is a far better approach than the code-base hack. Please add the Voodoo template to the documentation if you've had to override instances at runtime.

Resources

If you're new to MediaWiki development, here are some useful resource that you should check out to become more familiar: