I feel guilty...

I feel guilty for creating a static class in my otherwise OOP game engine!

Am I a sinner? Am I in need of purifying redemption? Am I the spawn of the devil? :wink:

We have a name for your pain… Misssster Singleton

[quote]We have a name for your pain… Misssster Singleton
[/quote]
Aye, but is static really that bad of a thing?

[quote]Aye, but is static really that bad of a thing?
[/quote]
Depends on what you’re doing. A lot of utlity classes don’t really need instances, so static methods are used. Singleton patterns are another example of where statics are useful.

How about you tell us what it’s for, and then we can give a yay or nay?

Static classes are nice for math operations that don’t come with Java’s Math class.

That’s what I use it for, to calculate physics.
If that’s what how you’re using it for then you are correct.

Singletons are only needed if you require a single instance of a class for the entire lifetime of your program.
I’m sure someone can give you some examples of this.

I’ll do my best, not sure how to explain it.

It’s for a loading system that is used to queue’s “Loadable” (interface) objects to be loaded, and then processes them.

It’s basically so I can easily set up progress bars and the like by running through the queue and updating the screen as I go. I didn’t really see a reason to have it a Singleton.

Hope that made some sense. :-\

i use static classes if i only need one instance of a certain class, which are usually controllers for things, like the controller for enemies is static, but the enemies them selves are not.