Discussion on boilerplate for code tightly bound to OOP
Julian Waters
tanksherman27 at gmail.com
Fri May 13 11:45:59 UTC 2022
I guess that makes sense depending on one's definition of the pattern, I
was just wondering out loud whether or not using enums with only one
instance defined compared to regular "POJO" classes for singletons in a
codebase is currently considered good practice within the ecosystem
best regards,
Julian
On Thu, May 12, 2022 at 11:41 PM Kevin Bourrillion <kevinb at google.com>
wrote:
> Tangent
>
> On Thu, May 12, 2022 at 6:16 AM Julian Waters <tanksherman27 at gmail.com>
> wrote:
>
> Granted, it would be interesting to
>> see them being added as a full-on language feature though (I'm unsure if
>> people using enums as singletons nowadays is encouraged or not).
>>
>
> (Is there controversy here? What is a singleton if not an enumerated type
> where N == 1? I don't think we're using enums "as" singletons, they just
> *are* singletons until you add a second constant.)
>
> --
> Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com
>
More information about the amber-spec-observers
mailing list