Monday, 22 October 2012

Benefits of JMVC

Currently I started working on JMVC , so after some R&D, I got the following points that really makes JMVC a better framework . It have many features like Controllers, Models, Testing, fixtures but here we will discuss only about the controllers of JMVC framework later on we will discuss other points. controllers are nothing but are simple plugin provided by JMVC, you can compare it with the 'fn' provided for jQuery plugin development. Now the most important part of controller is that It 'controls' a particular DOM element(It may be a simple 'span' or a 50 lines 'div'). We simply add our controller to  a DOM element  and from there our controller 'controls' the element. All methods on your controller which match a jQuery event , will be registered automatically on your DOM element.So what !!! what  we get by doing this???, Ya I know you have this question in your mind so lets play with some coding  to understand the benefits. Here I am presenting a code comparison without JMVC and with JMVC :

Without JMVC :


With JMVC:


Ok , now what our JMVC do? It simply register the DOM element with our controller and delete the tweets.
so we don't need to worry about finding the DOM element we simply right our functions and forget all other things. Thats make our code more easy.One more thing in JMVC we also provide new syntax of function defining which make automatic registration possible. 


Your mail are always welcomed at

No comments:

Post a Comment