Tuesday, July 8, 2008

What's all this pWorm craziness?

So you're probably asking yourself "With all of the PHP frameworks out there, why would anyone bother to create a new one from scratch?"

I have a few reasons, not least of which is that creating a good MVC framework is hard (especially if you include an ORM package). I'm hoping that by creating the framework, I can hone my coding skills. I'm also hoping that by blogging about the process, I can help some of you to be better programmers, too.

Another reason to do this is that I've spent some time with most of the major PHP MVC frameworks and I'm just not all that happy with any of them. The frameworks range from being way too complex when they just don't need to be, to being so simple that they're very inflexible when you need to do something that's a little more complex.

When the frameworks contain an ORM package, they tend to use the ActiveRecord or Table Row Gateway patterns. These don't work very well because of limitations in the PHP language and because the structure of your model class has to be very similar to database table structure. This is fine if you're creating the tables as you design your application, but it becomes a problem if you don't have that luxury.

I've also found there to be a lot of just general sloppiness in the way that most of the frameworks have been designed and coded. I think that requiring a CamelCase class name with a delimiter-separated file name is ridiculous.

The list can go on and on.

Don't get me wrong. There are a lot of great features and some magnificent coding in these frameworks and you can bet that I'll be borrowing a lot from them.

I think next time I'll give a little primer on some design patterns that we may find useful when designing the framework.

Until then...

No comments: