uMVC - A micro MVC framework in JavaScript

I tweeted:

You can write an MVC framework in one hundred lines of JavaScript & write about its effective use for one hundred thousand lines of English.

I wondered exactly how small I could write a respectable MVC framework that included the three fundamental design patterns of the traditional Smalltalk-style MVC: the observer, composite, and strategy patterns.

See the uMVC code on Github.

Hopefully this code is educational for those new to the MVC paradigm. I think this code is something every JavaScript programmer should understand inside out and be able to explain every individual line’s significance to another programmer new to MVC.

If you are looking for a more fully-featured MVC framework that follows the same principles of uMVC to use in real browser applications, I suggest you take a look at Maria.


Have something to write? Comment on this article.