views:

75

answers:

1

Hello all,

If I have two classes "A" and "B", is it OK to derive B from A and then make B a Singleton?.

Thanks for your help.

+9  A: 

Um, sure. Nobody is going to stop you.

If it's okay to make "some class" a singleton*, just imagine B being a new "some class". (It just happens to be derived from A.)

*Though, do you really need a singleton? (No.)

GMan
Probably No. Just because I have not used my hammer does not mean I may one day find a use for it. But usually my screwdriver works fine.
Martin York