Start Writing Embeddable Applications
Fellow Zender and all around nice guy Matthew Weier O’Phinney recently posted an article on his blog encouraging PHP developers to Start Writing Embeddable Applications. In it Matthew renews his call for developers to stop writing monolithic applications and start writing embeddable applications.
“Why embed?” you ask. Simple: if I’m creating a site that has one or two of these applications, but also my (or my company’s) own custom functionality, I may want to ensure that certain elements are present on all pages, or that I can control some of the content in all pages: a unified header and footer, ability to inject statistic tracking JavaScript, etc.
The predominant attitudes are either, “Don’t embed our app, embed your app in ours,” or “Just modify the templates.” Neither of these solutions is acceptable.
It’s an interesting read and an important concept for future application developers to consider. Matthew gives 6 pieces of advice to developers and my personal favorite is:
Don’t use $_GLOBALS ever. It seems like an easy way to keep variables accessible across classes and functions, but with PHP 5’s static properties, or judicious usage of singleton’s in PHP 4, there are other ways to accomplish the same effect with fewer side effects.
I encourage all developers to give this article a read.

Comments
(excuse my english...)