dmitry111, так например:
Factory.add = function (data) {
var name, constr, link = this.data;
for (name in data) {
if (data.hasOwnProperty(name)) {
constr = this[name] = data[name];
constr.data = constr.prototype.data = link;
}
}
};
Factory.data = function (name, value) {
var constr = (typeof this !== 'function') ? this.constructor : this;
return (value !== undefined) ? constr[name] = value : constr[name];
};
// (Constructor|Instance).data(name) get the constructor's name value
// (Constructor|Instance).data(name, value) set the constructor's name value and return it