Will this static class break in a multi user scenario ?
Posted
by
Perpetualcoder
on Stack Overflow
See other posts from Stack Overflow
or by Perpetualcoder
Published on 2010-12-31T08:40:31Z
Indexed on
2010/12/31
17:54 UTC
Read the original article
Hit count: 251
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?
© Stack Overflow or respective owner