What is Willowgarden? Day -1: Web 2.0
Only one more day to go until Willowgarden is launched. It’s a project that’s been under development for over eight months and contains concepts I’ve been working on for far longer than that. I had originally planned to release it sometime at the end of April, and last week when I discovered that April 28 is Arbor Day in the United States, I thought I’d take advantage of this opportunity — carpe diem! — and get ready for the launch. A little advance warning: this will be a Developer Preview. It will be rough, it will be missing some things that need to be there for a stable 1.0 release. But it will be a good start.
Today I want to talk about Web 2.0. What is Web 2.0? Many people have tried to define it, and some people hate the term, but I think it’s useful and here is my definition:
Web 2.0 sites are built using the latest open standards: XHTML, XML, CSS, and well-crafted Javascript. They provide transparent access to data using Web services/APIs and news feeds. They provide interfaces that behave more like desktop apps using Ajax techniques and scripted effects. They place an emphasis on clean, up-front, and personal graphics design and push the envelope of content interaction with new innovations such as the tag cloud or search auto-complete. They encourage attention to detail such as intelligent usage of the HTTP protocol via REST and program-independent URLs, protection of user data and input security against XSS (Cross-Site Scripting), and respect of users’ time, money, and various levels of computer proficiency. And that’s just the technical side of Web 2.0 — there’s also the social side, but we’ll stay out of that for now.
With that in mind, how do we as PHP developers translate all those requirements into a nice PHP app without banging our heads against the wall? Every single time you implement one of these features, you add an additional layer of complexity to the app — a layer which may prove to be inflexible and hard to maintain later on. For instance, suppose you’re playing around with Ajax, thinking “hey, this is cool! I can just return some HTML from the server and my Javascript code can set an element’s innerHTML property with that new HTML!” You implement it in no time, and it works great. But then what happens when you decide you need to update two different elements at the same time? What happens when the server has an error? What happens if you need to ask the user to confirm the operation if something on the server has changed? All of a sudden you find yourself having to rewrite code on both the client and server levels and completely alter the basic architecture of your app.
Or maybe you implemented an app with some different PHP pages on the server: products.php, policies.php, etc. Nice, easy, “page controller” design and all that you need. Then, later on, you decide to implement a REST API. All of a sudden http://www.mycompany.com/products.php?id=234 seems kind of silly when you realize you need a URL like http://www.mycompany.com/api/products/categories/flowers/234. Time to rewrite the app again.
Or maybe you had a page that listed a number of user comments for some particular item, and you come back a couple of months later and decide you want a certain user’s comments to be listed in that user’s “My Page” area for reference. Uh oh, now you have to extract all the code, templates, logic, etc. for showing user comments out of the original page and add it to the “My Page” files. Now you have code duplication all over the place. And maybe you want users to be able to view other user’s personal pages while you’re at it, which means your authentication system needs to be updated. And maybe you want to filter comments so bad language is blanked out….
The list goes on and on and on. If you aren’t careful, you could end up with a huge pile of incomprehensible spaghetti code that requires more and more time and energy just to add a tiny new feature to a Web app. Believe me, in times past I’ve done this myself, and it ain’t pretty. There must be a better way to write software.
And there is. Willowgarden aims to solve these problems by providing a simple, modular, extensible, base architecture which you can use to give structure and maintainability to your Web applications. Continue using the familiar paradigm of standard PHP pages in a folder while taking advantage of REST-style and search-engine friendly URLs, Ajax, and site-wide setup and configuration. Break your site down into data components that can render themselves to HTML no matter which page they’re on. Connect your custom user authentication system to a common, abstract API that your entire app can use in a consistent way. Reduce code duplication by taking advantage of Willowgarden’s intuitive object hierarchy that is fully-focused on real-world, cutting-edge Web concepts instead of imposing diagrams and theoretical design patterns.
If you aren’t intrigued yet, you never will be. Go to the Willowgarden Web site tomorrow, April 28, 2006 to download Willowgarden Developer Preview 1. All you need is PHP 5.1, Apache (IIS support coming soon), and a desire to build great Web applications. See you then.

Del.icio.us
Cosmos
Digg
April 27th, 2006 at 12:54 pm
OK so you have my interest!
All the best with Willowgarden, it sounds ambitious..