Is extending a singleton class wrong?
Posted
by
Anwar Shaikh
on Stack Overflow
See other posts from Stack Overflow
or by Anwar Shaikh
Published on 2012-03-26T17:26:20Z
Indexed on
2012/03/26
17:29 UTC
Read the original article
Hit count: 256
I am creating a logger for an application. I am using a third party logger library. In which logger is implemented as singleton.
I extended that logger class because I want to add some more static functions. In these static functions I internally use the instance (which is single) of Logger(which i inherited).
I neither creates instance of MyLogger nor re-implemented the getInstance() method of super class. But I am still getting warnings like destructor of MyLogger can not be created as parent class (Loggger) destructor is not accessible.
I want to know, I am I doing something wrong? Inheriting the singleton is wrong or should be avoided??
© Stack Overflow or respective owner