should singleton be life-time available or should it be destroyable?
Posted
by
Manoj R
on Programmers
See other posts from Programmers
or by Manoj R
Published on 2012-12-07T06:02:07Z
Indexed on
2012/12/07
17:36 UTC
Read the original article
Hit count: 225
Should the singleton be designed so that it can be created and destroyed at any time in program or should it be created so that it is available in life-time of program. Which one is best practice? What are the advantages and disadvantages of both?
EDIT :- As per the link shared by Mat, the singleton should be static. But then what are the disadvantages of making it destroyable? One advantage is it memory can be saved when it is not useful.
© Programmers or respective owner