We currently have a utilities class that handles a lot of string formatting, date displays, and similar functionality and it’s a shared/static class.
Is this the “correct” way of doing things or should we be instantiating the utility class as and when we need it?
Our main goal here is to reduce memory footprint but performance of the application is also a consideration.
PS. We’re using .NET 2.0
If there is any state in the class at all, then it is best to make objects out of it. Singletons are a pain, with respect to object dependencies, and thread safety.
If there is no state in the class, then the choice about whether to make it a static or not will have no appreciable affect on memory footprint.