What you have looks similar to the Singleton design pattern where you have a
static method that everyone can call without having to create any objects.
This in turn returns a single existing instance of a resource that is shared
by everyone. Apart from that I don't see any other reason for you to make a
static method which instantiates the class it is in. You can read more about
the Singleton design pattern here:
http://www.dofactory.com/Patterns/PatternSingleton.aspx
Adrian.
--
[Please mark my answer if it was helpful to you]
"koredump" wrote:
Is the following legal/recommended? (It compiles w/o error or
warnings)
class MyClass()
{
public MyClass()
{
}
private string NonStaticMethod()
{
retrun "Something";
}
private static string StaticMethod()
{
MyClass mc = new MyClass();
return mc.NonStaticMethod();
}
}