function Facade(){
	
	var objects = new Object();

	var hasNotification = function(obj,name)
	{
		var interests = obj.listNotificationInterests();
		for(var i=0;i<interests.length;i++)
		{
			if(interests[i] == name) return true
		}
		return false;
	}
	
	this.registerObject = function(obj)
	{
		if(!objects[obj.NAME]){
			objects[obj.NAME] = obj;
		}
	}
	
	this.removeObject = function(obj)
	{
		if(typeof(obj)=="string"){
			name = obj;
		}else{
			name = obj.NAME;
		}
		delete objects[name];
	}
	this.retrieveObject = function(name)
	{
		return objects[name];
	}
	
	this.sendNotification = function(name, body)
	{
		var note = {name:name,body:body};
		for( var key in objects)
		{
			var obj = objects[key];
			if(hasNotification(obj,name)){
				obj.handleNotification(note);
			}
		}
	}
	
}

