Prefer runmode-based configuration over hardcoded runmodes




Every now and then I come across code, which should be executed only on certain environments and therefor often relies on hardcoded runmode; while this often works, it's very unflexible; changing this behaviour (only for experimenting, bugfixing or troubleshooting) is not possible. You are better of if you make it configurable via runmode-based OSGI configuration.

I blogged about it:

AEM coding pattern: Run-mode specific code | Things on a content management system