Webstraction
My new foray into web development has been bolstered substantially by using jQuery for any client-side scripting needs. However, I’ve also been using a new server-side tool in my belt. I call it Webstraction… it’s a web development not-framework I’ve recently built.
I like the idea of web development abstractions. That’s what CakePHP, symfony, and Rails all are, at a very high level. They are systems which take care of lower-level grunt work for you, and free up your time to focus on site/application design, rather than the nitty gritty technical details of the actual programming itself. All basically serve to answer the same cry: I don’t want to write the same code more than once. For example, header logic that checks to see if the user is logged in, footer markup that displays links at the bottom of the page, left hand navigation, etc. You place the code for these in certain places, and then you include them where you need them.
Taking it a step further, many of these tools can actually automatically handle including the code for you - provided you put it in the right places, name it the right name, use it in the right fashion, and only need it in certain circumstances. Many of these frameworks will actually write code for you, if you take the time to learn their system.
Now, don’t get me wrong, there is absolutely nothing wrong with learning one of these systems, and then leveraging it to quickly churn out product. However, I take issue with them for a single reason. Say I commit hours, weeks, whatever, to learning Rails. To really learning Rails, and being beyond proficient with it. And then I spend the time to use it for several sites. What happens to the first site where I want to step outside of the Rails paradigm? Do something that it doesn’t support? Do something that goes against it’s main function?
It breaks, or you break. Either you have to go then into the Rails core code, and start hacking it up (making upgrading to newer versions highly time-consuming, if not impossible in some cases), or you have to break down, and give up your dream (or find a compromise to make it happen). All of these solutions are, to me, a bit unsavory.
What would really be nice, is a system that let you do what you do, but didn’t tell you how to go about it. Offered you a set of tools that made you more productive, but didn’t get in your way when you wanted to go and do something non-standard. That’s where Webstraction comes into play. Webstraction provides standard methodologies for building web pages and accessing common code. It is an abstraction in that, many times, the logical flow of page creation depends merely upon the existence or absence of a given file or directory. It provides a really smooth interface for having the system automatically grab all necessary php, css, and javascript files for you. Webstraction also has special handlers for Ajax requests. And, most currently, I’m in the process of redeveloping it to support plug-ins (which seem, on today’s web, to be an expectation (Just look at the communities around Firefox, jQuery, and Wordpress, for instance).
I’ve submitted the project to SourceForge with a GNU/GPL license, and a recent version is available for download there, however I’ve not yet completed the documentation site, nor have I migrated the Subversion repository. More updates to follow.
October 29 2008 08:12 pm | Development and Web