In my project, I have several static “service” classes that should be easily accessible throughout the project, and therefore they are static. However, in order to initialize them, I have to pass them data that is only available at startup time, which leads to the fact that the code is similar to this:
public static class VisualStudioEvents
{
private static Data _data;
public static void Initialize(Data data)
{
_data = data;
}
public static void Func()
{
AssertInitialized(_data);
}
}
What do you think about this? Is there any other project that should be applied here? Or is this design acceptable?
Thank!
source
share