Thursday, Debtember 13, 2007
Is separation of logic, display and language even possible?
I was just given a new project from Smirk, with one hard requirement (other than the specification of what the program is supposed to do)—it has to be in PHP (primarily because a) it's a web-based application and b) because it's interfacing to a bunch of other web-based applications written in PHP).
There is a chance down the road that this new project will be released as open source (much like X-Grey), and in order to gain traction as an open source PHP web-based application, it needs to support MySQL, although for our own use, we need to support PostgreSQL, which is nice, since then right out of the box, it'll support two popular database engines.
The only other sticky problem is i18n. I mean, other than character set issues, I want to make it easy to translate the software into other languages, which means keeping most of the text separated from the actual code. And while this is possible with PHP (with lots of self-discipline on the part of the programmer), I would also like a way to separate the language from the layout mechanics.
In other words, I would like to have the program logic, display logic and language independent (as much as possible) from each other, so that it's easy to translate to another langauge, and it's possible to change the look and feel of the program (to match an existing website).
Tall order, and I'm not even sure of the best way to go about handing this. I've seen how some other PHP web-based applications handle it (such as osCommerce and SugarCRM) and to say it's an ugly hack is an understatement.