Lately I've been trying to improve upon/move away from the standard MVC setup for web development, and I thought it was about time to throw my ideas at StackOverflow.
The general flow is the same in that a bootstrapper creates the initial objects. The difference is that these are then kept in a ServiceManager.
Then, instead of dispatching a controller, it loads the view.
The view then calls Commands and Queries. Commands represent functionality that is generally form-related (updating database rows, generally), and Queries are what normally would be ModelPeers. When these are created (via the ServiceManager) they have the ServiceManager passed to them, which gets rid of the need for a lot of potentially complicated dependency injection.
The models themselves would just do create/update/delete on a single row.
So a view would look like:
ListUsers.php
<?php $users = $this->ServiceManager->get('Query\User')->getNewestUsers(10); ?>
<?php foreach($users as $user): ?>
....
<?php endforeach; ?>
UpdateUser.php
<?php $this->ServiceManager->get('Command\User')->update(); ?>
<form>...</form>
I know that there's some tier violation, but it seems a lot cleaner than having a bunch of controllers that act more like ViewVariableSetters than anything.
It also makes everything much more testable since all functionality is encapsulated into Commands and Queries and away from large controllers. Technically, I could have a controller or ViewVariableSetter, but it seems like it would add a lot more code with very little benefit.
Any feedback would be appreciated, and please let me know if I can clarify anything.