Routing/Modularity in Dojo (Single Page Application)
===

I worked with backbone before and was wondering if there's a similar way to achieve this kind of pattern in dojo. Where you have a router and pass one by one your view separately (like layers) and then you can add their intern functionality somewhere else (e.g inside the view) so the code is very modular and can be change/add new stuff very easily:

**main.js**

    var AppRouter = Backbone.Router.extend({
    
    routes: {
            "home"                  : "home"},
    home: function(){
    
            if (!this.homeView) {
                this.homeView= new HomeView();
            }
            $('#content').html(this.homeView.el);
    
            this.homeView.selectMenuItem('home-link');
        }};
    
    utils.loadTemplate(['HomeView'], function() {
        app = new AppRouter();
        Backbone.history.start();
    });

**utils.js**

    loadTemplate: function(views, callback) {
    
            var deferreds = [];
    
            $.each(views, function(index, view) {
                if (window[view]) {
                    deferreds.push($.get('tpl/' + view + '.html', function(data) {
                        window[view].prototype.template = _.template(data);
                    }));
                } else {
                    alert(view + " not found");
                }
            });
    
            $.when.apply(null, deferreds).done(callback);
        }};

**HomeView.js**

    window.HomeView = Backbone.View.extend({
    
        initialize:function () {
            this.render();
        },
    
        render:function () {
            $(this.el).html(this.template());
            return this;
        }
    
    });

And basically, you just pass the html template.

Or, what is the best way to implement this using dojo boilerplate.