Page 1 of 1

MVC Framework Standards Committee

Posted: Fri Jun 26, 2009 10:18 am
by volomike
Okay, at this point, we've all realized that there's more than one way to do a framework, and it seems every 2 months we see a new PHP framework arrive on the scene. Actually, even though this has quite a lot of disadvantages, it seems the frameworks are learning from each other, and therefore has quite a lot of advantages as well.

On jobs and projects, whereas before I might have seen that they require only Zend Framework experience, I'm now seeing jobs and projects require at least an understanding of MVC, being more flexible as to not specify a framework. Or, they'll state they want knowledge of either Zend Framework, CakePHP, Symfony, or CodeIgniter, and right now I don't often see much else, but that may change.

So what I'd like to suggest is that we form a standards committee on PHP-based MVC Frameworks. Who more than us on DevNet -- the most popular PHP forum on the Internet -- could be in a position to do this? No one, in my opinion. The job of the standards committee is to specify a set of standards that are small at first so as not to hinder innovation in areas still rapidly changing, but yet latch on to great ideas and encourage new frameworks to use those great ideas.

For instance, here's a suggested standard:

Domain Task URLs (where applicable)

The PHP MVC framework must support at a minimum Domain Task URLs with ease if the framework is used for the web. Domain Task URLs look like:

http://mysite.com/my-domain-object/my-task/arg1/arg2/...

and this would translate to something very close to a physical file path of:

controllers/MyDomainObject/MyTask.php

and pass a variable amount of args to an array already loaded through a bootloader to the MyTask file. One merely needs to create a folder path and file and the URL routing from the front controller will automatically work. Other URLs should be possible, but the standard only specifies this common one.

Re: MVC Framework Standards Committee

Posted: Fri Jun 26, 2009 10:30 am
by onion2k
Some of the developers from those big frameworks are already meeting up occasionally to form a standard. I think they're aiming more for a coding standard than an MVC standard, but it's an obvious step once they've agreed on the first bit.

Re: MVC Framework Standards Committee

Posted: Fri Jun 26, 2009 11:31 am
by Christopher
I doubt if you could set standards, but perhaps you could document standards. And you could do comparisons, benchmarks, etc. Some of that is available around the web, but it is often not up to date. It sounds like a lot of work.
volomike wrote:For instance, here's a suggested standard:

Domain Task URLs (where applicable)

The PHP MVC framework must support at a minimum Domain Task URLs with ease if the framework is used for the web. Domain Task URLs look like:

http://mysite.com/my-domain-object/my-task/arg1/arg2/...

and this would translate to something very close to a physical file path of:

controllers/MyDomainObject/MyTask.php
What's a Domain Task? The first standard you suggest does not reflect the way any of the frameworks you mentioned works. All use "domain.com/foo/bar/arg/arg" style routes, but here the differences begin:

- File names are controllers/foo.php or controllers/foo_controller.php or controllers/FooController.php,
- Class names are foo or FooController,
- Method names are method bar() or barAction().

So they all agree in the 'controllers' directory. But the only places where two of the frameworks you mention have any commonality are Cake/Zend with FooController class names and CI/Cake which both use bar() style method names. So what should the standard be?

It might be interesting to find an specific differences in routing between the frameworks. That would be informative. But my guess is that because the routes are programmable they could all accept almost any kind of route. But perhaps comparing routers would be a place to start.