OK. I’ll revert that change.

I like the idea of private constructors. That does make more sense than making 
the class abstract. Singletons was one of the areas that I was wondering how we 
could improve, and this sounds like a great proposal.

Thanks,
Harbs

> On Jan 25, 2019, at 8:17 PM, Josh Tynjala <[email protected]> wrote:
> 
>> I would never occur to me to use abstract for static-method-only classes.  
>> In fact, to me, it makes those classes look like base classes that should be 
>> subclassed before using.  In Java they allow private constructors instead 
>> and I believe that is the recommended pattern for static-method-only classes.
> 
> Interesting! I've never thought of using abstract in that way. I agree with 
> your conclusion about classes with only static methods. When I see that a 
> class is abstract, my first thought is that it is meant to be subclassed 
> specifically so that it can be instantiated. I guess you could also make it 
> final, but that's still potentially confusing.
> 
> I was actually considering private constructors as a potential future 
> enhancement. It would allow developers to prevent static-method-only classes 
> from being instantiated, and it would enable a less-hacky way to implement 
> the singleton pattern.

Reply via email to