This pseudocode depicts a design pattern. Is it the factory method or prototype?
global instance
class Object is
constructor Object() is ...
method getInstance() is
if (instance == null) then
instance = new Object()
return instance
method doThing() is
print Object
class Application is
method main() is
Object foo = Object.getInstance()
foo.doThing()
//"foo" will be printed
Object bar = Object.getInstance()
bar.doThing()
//"foo" will be printed again