Class was designed with Protected Constructor as a SingleTon Class.
It is shipped to Customer. Now need to submit a patch such that this Protected constructor can be made as a Private.
is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am guessing by your user name that your language is java…
A singleton must have a private constructor to be safe – otherwise it’s not guaranteed to be a singleton!
You should just make it private. If your customer has subclassed your singleton and used the protected constructor, too bad. You shouldn’t break your application design just to provide support for poisoned legacy code.