3 February 2004
Mojavi: PHP MVC Framework
Posted by Ryan Sarver under: Programming .
Some people will argue that OO (object-oriented) development in PHP is overkill. Most of this bias is because they’ve had a bad experience with OO development in general. I can see their point of view, because learning to develop in an OO environment has a steep learning curve. But once the person gets a few hours of OO development under their belt, the curve slowly shrinks to that of speed bump. After that point, they’re cruising and developing OO applications like there’s no tomorrow. Other people may argue that OO isn’t necessary in a PHP environment, because they think a PHP web application can’t get complicated enough to warrant the need for MVC. Or they’ve found an easier, more workable method of reusability that suits their own needs.
What I’d like to discuss briefly is the importance of developing reusable web application components. A component isn’t necessarily a module, or something that ties directly into a parent application. A component can be something independent from the rest of an application, such as a message forum. In the MVC sense, a component usually is an action or module (a group of actions, all working together for one common cause). When reusable components are written, others can benefit. There’s no sense in reinventing the wheel so to speak, unless of course you don’t agree with the way the wheel is turning.
To put my argument into perspective, I’d like to reference something completely unassociated with any web application development. The topic is Quake. Yes, the game, written by id Software. Why was Quake such a hit? And why is it still so popular today? Is it because it’s a really fun game to play? Sure, that has something to do with its popularity. But I’d bet my paycheck when I say it’s more popular because it was the first game that provided a modular system, where gamers could write simple scripts that allow you to customize the way the game is played. It was and still is innovation at its best.
Innovation breeds loyalty. What happens when you find a new, cheap or free application that helps you cut hours of time from your schedule? You get excited. After you realize that, you go and tell everybody you know about the application, because you want them to save time too. Now, you’re hooked on the application. Typically there are hundreds of applications out there that are similar in one way or another. And you’ve tried a few of them, but didn’t like them. But what brings you back is innovation and ease of development. It brings to the table what the others didn’t even have in mind. That’s why it’s so useful and why you’re their newest loyal member.
Deciding on a PHP MVC framework is based on the same principles. You need a framework that suits your needs. It needs to be implemented in a way that’s easy for you to understand. And most importantly, it needs to provide the ability to drop in reusable modules. My friend, Sean Kerr, has developed an elegant solution to the problem, called Mojavi. The source code is clean and well thought out. The implementation of the MVC paradigm is unsurpassed. And it provides a tough-as-nails list of features that blow other PHP MVC implementations out of the water. You can check it out at http://www.mojavi.org. I urge you to try the 2.0 milestone b2 release, because although it’s labeled a beta, it’s still pretty stable. Version 2.0 provides much of the functionality that you won’t find in another PHP MVC implementation, but it isn’t documented yet. Sean is nearing completion on the 2.0 API documentation and will have them released shortly. For now, the source is just as good, because the API documentation is generated from it.
Check it out, try some of the example applications and test it on a project. We use it and love it, and I am betting you will too.
