Monday, September 6, 2010

JavaScript MVC

This article provides a great start to implement the MVC pattern. I would argue, however, that it can be improved because it doesn't match the definition of MVC from Wikipedia.

One of the problems with the article below is that the View knows about the Controller and the Model, when it should only know about the Model. Although there is at least another problem (hint: the controller doesn't know about the View), it is very easy to fix and you get a perfect implementation of JavaScript MVC.

I am doing this with ExtJS, I'll post some code after I get it to work.

No comments: