I have a configuration class that is shared in my project:
public class BarcodeConfig
{
public string LotStandardDigits { get; set; }
public string LotOldStandardDigits { get; set; }
public int LotOldNumofDigits { get; set; }
public int LotStandardNumofDigits { get; set; }
}
In my main class implementation i have 2 classes. One static (for utilities and the other that contains all my intended logic:
public static class BarcodeUtil
{
...
}
public class BarcodeBLL
{
...
}
I want to be able to use the same configuration class for both my static and normal class. Is it best to make the config class static? or not?
I prefer instantiating config object. In case of those static methods I’d pass the config as an argument to each of this utlility methods separately.
This allows to use utility methods for completely different purposes by completely different modules at the same time and makes them more elastic.