A simple Javascript MVC | Alex Kessinger
I am starting to work on a big project, and apart of that big project is that I need to start looking at MVC in JavaScript. I think that MVC is something that many app developers understand, and it's a great paradigm for creating most web applications. This extends to creating self-contained HTML5 Apps for the client.
I set out to do a search and I found a couple of examples.
First, of course, not all of them are not strictly speaking MVC. Some are huge complex pieces of work like SproutCore, and Cappuccion, but I think this forms a cast of the usual suspects.
I might be an idiot, but they all seemed too complex for the job. The job of creating a simple MVC, for creating a simple HTML5 App. Which makes a little sense. If you look at the world of server side MVC, we had Django, and Rails, before we got djng, and Sintra.
Now I am in a position where I want to just write it myself. Which I know is hardly ever the answer, but I swear, I really think nothing else there is doing it right.
First thing I want to do is write as little code as possible, so I want to rely on already well written code. jQuery will be the base. For the "Model" part, which I don't really thing we need models, just a data abstraction, I am using LawnChair. For templates I am going to go with Mustache. The biggest reason to use Mustache, is that whatever your backend is written in you too will probably be able to use mustache there too, why learn two template systems when you can learn one.
I have a early look see up on github SimpleMVC.
You can see an example, with code snippets here
