Tom Emerson - 2007-08-27

In the book, "headfirst design patterns", there is a notion of a "singleton" pattern -- a class/object/entity/whatever built in such a way that one and only one instance will ever exist within the scope of the program.  There are a few things in any simulation that have to exist as "the one and only" -- for instance, the current "time" within the simulation, or even the "world" in which the simulation exists [unless you want to explore parallel universes?]

I'd like to use this thread to discuss and design those items which must be singular throughout the simulation.  I've already mentioned the two biggest ones, the "world" proper and some notion of "what time is it" [but see the thread, "Anyone got the time?"]  Right now, the only other item I can think of that needs to exist as one-and-only would be the resources proper -- not so much in the sense that there would only be one "resource", but rather that any given "resource" exists as a single entity -- in a sense, we'll have a "singleton factory" in which each object that gets produced will be unique and non-duplicative.  i.e., a rock is a rock is a rock -- once defined, the characteristics are immutable [you'll have a hard time trying to convince me otherwise...]