Yahoo have created an excellent resource online called the Yahoo Design Pattern library which helps to illustrate solution to design problems; not design in the creative sense, but in the problem solving sense.
They’ve just added a bunch of solutions around manging and engaging people in reputation management online.
Archive for the 'patterns' Category
[ftf]class MySingleton {
private static var _instance:MySingleton = null;
private function MySingleton() {}
static function getInstance():MySingleton {
if(_instance == null) _instance = new MySingleton();
return _instance;
}
public function doSomething() {
trace(”This is a singleton method”);
}
}[/ftf]
The purpose of a Singleton is to enable access to it from anywhere and ensure you don’t ever have more than one. Another way of looking at it is a _global container of data without using _global.
