mardi 11 août 2020

Is the argument of breaking SINGLETON pattern with REFLECTION practical?

I learned about SINGLETON to be implemented through enums, so that, it retains the singleton nature against reflection also.

Can there be a practical industry/realTime scenario, where such thing could happen ?

My understanding is NO.

When all the code is with me, why will I have such a thing happen to any singleton class at my code.

Rather, such code practice, would be visible to those having access to code repository, so it wont skip the eyes !

Asking to understand, if I am missing some perspective, through which this could actually happen !





Aucun commentaire:

Enregistrer un commentaire