On Wed, 7 Aug 2024 15:34:37 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
>> But the annotation costs no bytes per instance, if that even matters, as I >> thought these were singletons so it looks like we're quite into >> micro-optimization territory here. > > Whether a style converter supports reconstruction should be a statement about > the type, not a statement about the instance. For this reason, I don't prefer > an instance method like `isSupportReconstruction()`. In any case, these are > our options: > 1. Boolean parameter / Feature enum passed to constructor > 2. Instance method `isSupportReconstruction()` > 3. Annotation > 4. Empty marker interface > 5. Interface with the `convertBack` method > 6. Subclassing > > I lean slightly towards the annotation, but I'm generally okay with either > option. I just saw a boolean variable being instantiated from an annotation and thought "why jump through the multiple hoops?". since there is a boolean, why not pass it directly? it's less about memory allocation (though I would prefer to minimize that as well, but as @hjohn pointed out the difference is just a few bytes), but more about "entities must not be multiplied beyond necessity". ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1522#discussion_r1707345002