Will this static class break in a multi user scenario ?
- by Perpetualcoder
Say I make a static class like following with an extension method:
public static class MyStaticExtensionClass
{
private static readonly Dictionary<int, SomeClass> AlgoMgmtDict
= new Dictionary<int, SomeClass>();
public static OutputClass ToOutput(this InputClass input)
{
// clears up the dict
// does some kind of transform over the input class
// return an OutputClass object
}
}
In a multi user system, will the state management dictionary fail to provide correct values for the transform algorithm? Will a regular class be a better design or shoving the Dictionary inside the method a better design?