var Model = Class.create({
    _storage: false,
    _viewInstance: false,
    view: {
        initialize: function() {},
        modelView: function() {}
    },
    _View: (Class.create({
        _vars: {},
        assign: function(name, value) {
            if (typeof(value) != "undefined") {
                this._vars[name] = value;
            } else {
                for (argName in name) {
                    this._vars[argName] = name[argName];
                }
            }
        },
        render: function() {
            return this.modelView();
        }
    })),
    getView: function() {
       if (!this._viewInstance) {
           this._viewInstance = new (Class.create(this._View, this.view));
           this._viewInstance.object = this;
       }
       return this._viewInstance;
    },
    _getStorage: function() {
        if (! this._storage) {
            if (!("Page" in window)) {
                this._storage = Compare.data;
            } else {
                this._storage = Page.getInstance().getFlights().getData();
            }
            
        }
        return this._storage;
    }
});

