On the server side, I always use some form of an MVC toolkit. It simply makes my life that much simpler, and my code that much easier to maintain.
On the client though, I find that what we do is slightly different. I like to think of each of my widgets as a micro-MVC, and my main.js file as a bootstrap. - Most Classes have a model - mostly a Request instance, but today this can also be local storage or cookies. - Every time a Classs implement Event it almost instantly becomes a controller. - The view usually means transforming the data into an element/s. As a result of the above, I try not to mix more than one Class per element. The closest thing to a domain controller that I can think of is a Domain Dispatcher/Observer object, which delegates costume events between separate Classes. Again - this is a very generic operation with Events, which is a very important piece in what make Mootools such a strong development platform. On Mon, Nov 8, 2010 at 4:53 PM, Maxim Lacrima <[email protected]>wrote: > On 8 November 2010 16:17, Olivier El Mekki <[email protected]> wrote: > > Hello, > > > > Do you guys use mvc in your code? > > > > I joined MooTools community several days ago. I am currently exploring > Mootools API and searching for tools that can help me in my project. > My main language is Python and I have used python port of PureMVC > framework for some desktop projects. Now I want to try javascript port > of PureMVC, which actually is based on MooTools, but it was released 9 > months ago and I am not sure that it is compatible with 1.3... If > someone more experienced than me could take a look on it to check if > it is compatible with 1.3 I would be very thankful! > PureMVC JS site: http://trac.puremvc.org/PureMVC_JS/ > > > > > > I used it several times for big js apps, typically putting the ajax > > requests and data parsing/transformation in models, the events in > > controllers and dom manipulation in views. > > > > On my current project, I argued we do not need mvc since it was mostly a > > collection of widgets, each having a couple of events and dom > > manipulation. > > > > I was said that the application may become way more complex then, and > > that I should consider the extendable part of the thing while > > implementing it. > > > > At this point, I remembered there was such debate when backend language > > frameworks became popular, with some people saying mvc was a pattern and > > as such should only be implemented when the project requires it. > > > > Clearly (imo), webapps have greatly took advantage of systematic > > implementation of mvc, turning it into something that is way more than a > > pattern among others. > > > > In the era of minification, we can afford writing a bit more of code to > > have it more organized ( that's quite what moootools is about comparing > > to others libs, anyway ). > > > > Do you think mootools, and javascript in general, could take advantage > > of systematic mvc? > > > > -- > > Olivier El Mekki. > > > > > > -- > with regards, > Maxim > -- Arieh Glazer אריה גלזר 052-5348-561 5561
