0

So I have a class called app. It is just a class that controls all the other classes inside of it. Mid development we discussed to make this app class a singleton. This makes clear to other developers that there should only be one App. This sounds logical and is the correct way to use a singleton. The only questions arises that if you use this singleton to access its properties and make them accessible for others. Are you then using a singleton "incorrectly"? I know you should not use singleton "because it's convenient". But is this the case here?

1 Answers1

2

If you use this singleton to access its properties and make them accessible for others, are you then using a singleton "incorrectly"?

Short answer: No

Long answer: It depends

Medet Tleukabiluly
  • 11,662
  • 3
  • 34
  • 69