Daedalus.Base = OpenLayers.Class.create();
Daedalus.Base.prototype = {
    /**
     * @type {Object}
     */
    slots: null,

    connect: function(signame, obj, method) {
        if (!this.slots) {
            this.slots = {};
        }
        if (!this.slots[signame]) {
            this.slots[signame] = [];
        }
        this.slots[signame].push(method.bind(obj));
    },
    
    signal: function() {
        var signame = arguments[0];
        if (this.slots) {
            var slots   = this.slots[signame];
            if (slots && slots.length) {
                var args = [];
                for (var i = 1; i < arguments.length; i++) {
                    args.push(arguments[i]);
                }
                for (var s = 0; s < slots.length; s++) {
                    slots[s].apply(this, args);
                }
            }
        }
    },
    
    /** @final @type String */
    CLASS_NAME: "Daedalus.Base"
};
