1

Topic: question about MVC relations

if you saw this diagram in Wikipedia about the MVC
http://en.wikipedia.org/wiki/Model%E2%8 … controller
you would see a relation between the view and the model
for me i hadn't remembered any Zend Framework component has done this relation
can any one explain to me how this relation is done
and example will be nice smile
note :to exclude the dashed relation its out of the question scope

2

Re: question about MVC relations

Hey Tawfek, ZF doesn't do MVC is this manner, with the implicit lines working through an observer. However, when you do something like

PHP Code:
 
$this->view->user = User::findByName("jon");
 

and then in your view:

PHP Code:
 
<?php echo $this->user->name; ?>
 

you're still decoupling the view from the model. MVC came out of smalltalk / lisp as a way of maintaining integrity across 3 layers. In a desktop (or AJAX) app, MVC closer resembles this because every action doesn't result in a postback. The postback makes the whole MVC thing a little different on the web.

here's a great essay on MVC and it's development:
http://www.ctrl-shift-b.com/2007/08/int … cture.html

I also found this, that I think answers your question (Microsoft's MVC implementation is a reflection of Zend / Rails' MVC implementation):

http://stephenwalther.com/blog/archive/ … f-mvc.aspx

3

Re: question about MVC relations

thanks Jon ,
the second article helped me alot