PHOCOA PHP Framework

WHY on earth did I build another framework?

In 2003 I had been programming web apps for 6 years, on many different platforms. There was a lot of change going in web app development; people were starting to see better ways of building web apps to do it faster and in a more maintainable way. I know I was sick of building apps the "old-fashioned way" -- starting from scratch every time and longing for a cleaner way to do things.

About that time, I did some Mac OS X programming for a contract job. I was amazed at the simplicity and elegance of building apps with Cocoa. After going through that experience, I just couldn't bring myself to continue writing apps the old-fashioned way. I wanted to spend my time implemented my ideas, not writing glue code and database calls.

So I started looking around at the PHP landscape, looking for php frameworks. I also looked at some non-PHP projects. There were beginnings of things, but nothing at that time had any major community, documentation, or general sense of well-being. It seemed everyone was going through the same thing I was.

As I researched frameworks, I ended up with a list of things that I really cared about, and things that I didn't like, and wanted to avoid. Finding no solution that met these needs, I set out to write my own framework.

My Framework Checklist

    REQUIREMENTS
  • Clean MVC Architecture
  • Abilty to have complex UI logic neatly separated
  • Skinning system
  • ORM Tool
  • Easy Component Re-use
  • A real dev framework, not a CMS with plugins
  • Integrated validation and data sanitation
  • Minimal code writing
  • Very loosely coupled; good OO design
  • Open Source; BSD/MIT-style license
  • Clean URLs
  • Full pagination and sorting infrastructure
    ANTI-REQUIREMENTS
  • NO app-level configuration needed to add each web page
  • NO complex deployment infrastructure
  • NO to getting stuck if the framework doesn't already support what you're trying to do
  • NO massive code-gen infrastructure that results in lots of code that is hard to understand, improve, or maintain
  • NO writing glue code
  • NO display logic in model objects

Given this list, I just couldn't find anything that fit the bill. So, I decided to write my own, adapting the lessons I learned from Cocoa to the web.

Additional Motivations

Once I got started, I decided on a few concepts I really wanted to try to solve. I wanted users of the framework to not have to worry about the fact that they're writing for the web. The web is a stateless environment, and there is a lot of work to "fake statefulness" over HTTP in a clean way. I wanted to isolate framework applications from this complexity as much as possible.

PHOCOA is conceptually very similar to many other modern web frameworks. There are always differences in architectures, and I figured that some people would like my architecture better. For the ones that want the same things I do, hopefully we can all make PHOCOA better together.

Copyright (c) 2008 Alan Pinstein. All Rights Reserved.