c# - Should a class that provides functionality be static or singelton? -
i'm writing c# app, , have class dos provide functionality different class use. example class provides clock service , more. there reason make class singelton class? or static class? or maybe should not either?
if class needs keep inner state should singelton
, if doesn't make static
!
inner states be:
- a file reference
- a user preference
- any kind of history
if merely collection of functions etc.. math
, kiss (keep static)!
Comments
Post a Comment