Eric Gunnerson, Visual C# Program Manager at Microsoft blogs about new features in C# for VS.NET 2005 including this post on static classes.
-
-
If you have a static class full of static methods aren't you really just defining macros (without all of the problems that go along with macros)?
-
You know, I agree with you… Static classes can *certainly* be abused. Static classes are not a very “OO” friendly concept. That said, good API design is a compromise between pure OO design and usability. There are just some cases where the problem space doesn’t warrant full OO mapping… Check out System.IO.Path as an example.
We have used static classes a judiciously in the framework and it is good to see that pattern being enforced in the compiler.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.