I was under the impression that singleton is the proper design pattern which adds the flexibility for the design to evolve, extend, etc. , where globals are just a workaround. But in a question asked in this forum I was told try to avoid singleton pattern and go for global non-member functions. What is the reason for this?
I was under the impression that singleton is the proper design pattern which adds
Share
Here is a reference page: Global vs Singleton in .NET
In my understanding, with singleton, I can control when the object is initialized. But with globals, it’s a little difficult to do it.