My background is jQuery/require.js/backbone.js!
In order to broaden my horizon I’m taking a closer look into Dojo.
In backbone.js you have the view component. Some people would rather say it’s a controller.
So if I want to set up a new page controller, I generate a new backbone.js view and I have a very nice and useful collection of methods available.
I found a Dojo 1.7 tutorial for a page-level controller (http://dojotoolkit.org/documentation/tutorials/1.7/recipes/app_controller/). But I was quite disappointed to learn that the page author did the whole controller from scratch.
He wrote in the summary:
The controller could have been derived from a class.
Maybe, to keep the tutorial simple, he didn’t mention the base class you normally use for this kind of real world controller.
Or is there really no base class you can use?
Maybe there’s some 3rd party class with a permissive license?
Thanks a lot in advance
Wolfgang
Update:
Thank you, Chris Mitchell, for your answer. I’m glad to hear that there is a lot of development in dojo client mvc.
So the jQuery/jQuery UI/backbone.js stack is maybe a little step ahead in this page controller matter. But dojo is really a great framework.
I guess, as far as I understand, relating to MVC WIDGETS dojo has more to offer than jQuery UI:
Dojo widgets already have widget templating, whereas jQuery UI does not have this at the moment.
If you look into the source code of a jQuery Ui widget, there is no such separation, HTML snippets are “built”/concatenated with Javascript, this is much harder to maintain.
According to the blog post from Boris Moore (http://www.borismoore.com/2011/10/jquery-templates-and-jsviews-roadmap.html) the jQuery UI team maybe goes in the same direction.
Generally, in the jQuery realm I haven’t seen that many mvc widgets:
One example is a jQuery Autocomplete Plugin with backbone.js models
(http://www.planbox.com/blog/news/updates/jquery-autocomplete-plugin-for-backbone-js.html).
This is a very interesting question.
I’ve been using Dojo for a long time (5+ years) and I am not aware of anything like this in the kit.
It seems like a relatively new idea (at least, I’ve only heard about it in the last couple years) to implement a full-blown MVC pattern in the client-side JS. It does seem like a good idea though.
It seems especially relevant to Dojo, given that it has such support for large-scale, one-page apps. My opinion is that is where Dojo shines. A consistent, MVC based way of managing the over-all client-side app would seem beneficial.
Its one of those things that is going to end up being built by an app, why not make it official?
Update
Someone on the mailing list mentioned there is a dojox.mvc project.