I just wondered what the best way is to get rid of the globally available static getInstance() in a Singleton. I do not want my Singleton classes being accessed from every point in my program.
I thought about maybe having a create() public static function that creates one object and returns it but one cannot call this method twice.
But it's not very elegant for me. Than I would have to make an assertion or throw an exception in case create() gets called a second time.
Is there any other way I can achieve what I want?