Design Centric Design Pattern
Posted: Sat Oct 06, 2007 8:54 am
Hi All,
Just finished one more project and I'm going to set some time on writing my own php framework..., but I might start from a different angle.
My company starts as a printing-design and tradeshow company and in recent years jump on the web arena.There are many design-gurus, but I found that once I mentioned things like "Perl,Ruby, MySQL, Mod_Rewrite, PHP Framework...", they instantly get bored, but whenever they see those fancy AJAX and flash interactive sites, they are lighted up by fire. Their way of thinking is quite different. (what they call the left brain and right brain?)
On this project I'm involved, I used a different way..., instead of planning the application controllers, drawing data diagrams, doodling some ideas on the paper while they there listening to rock music for fear of falling asleep, I always talk with them with screenshots or dummy html pages showing how this project will look like. They are happy and they don't care how the data in those dummy pages are processed.
At the same time, I set aside sometimes every day studing many MVC frameworks, after a deep study of ROR, CakePHP, CodeIgnitor, I found they all share this pattern:
1. A request of the page comes in
2. The dispatcher send that request to a controller
3. The controller then render different views
It's like
Request->Dispatcher->Controller->Views
But what if I start from another angle:
1. Set up different possible views.
2. Fill the view with possible data.
3. Each view then maps to one controller.
4. The controller then corresponds to each request.
It's like
Views->Controllers->Dispatcher->Request
So it's like start from bottom to top.
The controller only process possible signals (link request, form post...).
Controller get and process data through models.
If a view is discarded, the corresponding controller will be discarded too. Here I think maybe "The view is the controller".
I found that I finished the project faster than I used to.
Is this pattern sort of "View Centric" and what do you think of this pattern?
Sincerely,
Jim
Just finished one more project and I'm going to set some time on writing my own php framework..., but I might start from a different angle.
My company starts as a printing-design and tradeshow company and in recent years jump on the web arena.There are many design-gurus, but I found that once I mentioned things like "Perl,Ruby, MySQL, Mod_Rewrite, PHP Framework...", they instantly get bored, but whenever they see those fancy AJAX and flash interactive sites, they are lighted up by fire. Their way of thinking is quite different. (what they call the left brain and right brain?)
On this project I'm involved, I used a different way..., instead of planning the application controllers, drawing data diagrams, doodling some ideas on the paper while they there listening to rock music for fear of falling asleep, I always talk with them with screenshots or dummy html pages showing how this project will look like. They are happy and they don't care how the data in those dummy pages are processed.
At the same time, I set aside sometimes every day studing many MVC frameworks, after a deep study of ROR, CakePHP, CodeIgnitor, I found they all share this pattern:
1. A request of the page comes in
2. The dispatcher send that request to a controller
3. The controller then render different views
It's like
Request->Dispatcher->Controller->Views
But what if I start from another angle:
1. Set up different possible views.
2. Fill the view with possible data.
3. Each view then maps to one controller.
4. The controller then corresponds to each request.
It's like
Views->Controllers->Dispatcher->Request
So it's like start from bottom to top.
The controller only process possible signals (link request, form post...).
Controller get and process data through models.
If a view is discarded, the corresponding controller will be discarded too. Here I think maybe "The view is the controller".
I found that I finished the project faster than I used to.
Is this pattern sort of "View Centric" and what do you think of this pattern?
Sincerely,
Jim