Dummy Proofing your Applications
I recently came across a problem developing an application that I hadn’t thought of before (mostly because it’s not something I’ve ever had to do before) but is, in its generic sense, a problem as old as computers themselves. That problem is, of course, portability.
No I’m not talking about the dreaded Windows/Unix/Apple debate. I’m talking about something as simple as database technology. I was surprised to find out that PHP didn’t natively support database driver interchangability! Even Java supports it (to an extent), yet I was 3 weeks into my project before I realized that my testing server was running MySQL, but the production server was going to be running PostgreSQL.
I spent the night lying awake debating how long it would take me to write a database abstraction class, and how much work and overhead and error checking it would require to be able to support two different database drivers with different capabilites. I was pleasantly surprised when a bit of Googling brought me to the rather robust (and thankfully open source) ADOdb project. Problem solved.
This sort of plug and play programming is gaining ground, and for good reason since it’s an incredibly easy way to write applications, however the overhead involved with lashing together several large API’s into a functioning application can create its own problems in scalability. Open source applications running on private servers with a small user base, such as WordPress installations, don’t have the same problems as closed source applications such as Facebook or Twitter with incredibly large user bases.
The problem comes when your application becomes popular enough that other people want to interface with and get information from it. You’ve spent all this time and effort lashing together a functioning application with the digital equivalents of duct tape and string, and now someone wants you to change it. So now you’re left asking yourself if it’s worth it to rewrite the back end with native support for the new functionality, or should you just strap on an XML abstraction and hope the whole thing doesn’t take a flaming leap off a cliff?
The best way to go about doing this is to take scalability into account when designing the application. Even if you are using open source modules in your development, you should be using them as an abstraction layer on which to build your application, that way you can write small modules that rely on existing code to add in functionality in the future instead of rewriting existing code and potentially breaking existing functionality.
How do you go about developing applications or new projects?