Wednesday, November 7, 2007

Frameworks and Helpers

I've been recently refactoring and adding new features to Dishola.com and started off taking greater advantage of CakePHP's Form helper object. But here's the rub, and this applies to all framework objects, the more advantage you take of these things at the markup level, the less your presentation layer is separable from your controller logic. And of course, helper code generally has its own quirks for handling customizations that don't fit the mold, so now you're programming your presentation layer in another language other than markup. Sometimes you want a small bit of text after the label, sometimes after the input, so you tweak things in the helper code, but now you've got this spaghetti of stuff that's in some ways handy and also language-binding for your webapp.
I'm always pondering switching languages, or rather, the ability to. I don't want to be owned by my language or my framework. In theory, great full-stack framework webapps should be easily rewritten into one another without too much work at the controller(business logic) level. So why muck that up by leaning on your framework to help with your presentation? Sure it aids rapid development, but at the cost of making you your framework's bitch.

1 comment:

Christopher J. Bottaro said...

I actually think submitting to the framework is normal and expected. It's like that by design: you give up a lot of freedom for convenience. JMO.