“Singleton” factories, ok or bad?

后端 未结 6 735
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 08:55

I\'ve a lot of (abstract) factories and they\'re usually implemented as singletons.

Usually for the convenience of not having to pass them through layers who really hav

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 09:07

    Is this considered best practice?

    I see no problem: you said "my programs don't need more", therefore your implementing anything more flexible/abstract might be a case of You Ain't Gonna Need It.

提交回复
热议问题