From: thufir Date: 2008-03-28T15:40:23+09:00 Subject: Re: Need help with singleton! On Wed, 19 Mar 2008 12:22:26 +0900, Diego Bernardes wrote: > Yea, again a question to help me building the game XD I have a class > called Mob, when i instance a mob from the main i search the name of mob > in a list, if the name is there i create it and i call a singleton class > with all the images of the mob, so if i create the same kind of mob > again he will create it and use the images from the singleton, to save > memory. my understanding is that it's good practice to write good code, use patterns, standard idioms and so forth, and *then*, if there's a performance problem, start figuring out where the problem is. I think you may have the horse before the cart in that sense. Not that singleton isn't a great thing, it is! -Thufir