Tag Info

New answers tagged

0

What you describe is a thinly-veiled coating over Singleton. Essentially, you have global state and are trying to funnel access through that one class. The fact that the interface is static instead of object-owned is the "coating" I referred to. This is one of the few acceptable uses for Singleton. While that pattern is often misapplied, providing a single ...


0

Personally, I would not like to live with static methods to keep consistency across a code base. The advantages, whether you consider them "real" or not, of injecting the settings lie, as always in the freedom gained and the disadvantages avoided. I'd always prefer to inject a settings instance as it ties you down the least and doesn't force you to use a ...


0

From a pragmatic view I would recommend to use whatever works best, with the least maintenance effort. In this specific situation, I would probably go with "option 3": separate the part which reads the connection string from the part which creates the actual connection into two different methods. So the connection string becomes an input parameter of ...



Top 50 recent answers are included