RFR: 8240692: Cleanup of the javafx property objects

Kevin Rushforth kcr at openjdk.java.net
Sat Mar 21 17:22:44 UTC 2020


On Mon, 16 Mar 2020 12:47:44 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

>>> So this begs the question: Do we still want to do this? Is the cleanup worth the extra memory used?
>> 
>> I'm not sure. This raises the opposite question: are there any places where we can benefit from introducing anonymous
>> classes instead of the current implementation?
>> In my own code, I prefer the readability and conciseness over performance. However, since JavaFX is a library, we might
>> want to go with the performance route. I don't know how important the memory consumption is for users in this case or
>> the other similar cases.
>
> Just playing devil's advocate :)
> 
> Technically, there's a functional difference between the inline extension and useage of SimpleXX: in the former,
> getName returns the current name of mapped property, in the latter it returns its name at the time of creating the
> mapped property.   Afaics, there is nothing in the spec of getName that prevents custom implementations with name (and
> bean) being mutable (the SimpleXX have implemented them immutable, but then they are only default implementations). Not
> that I can imagine any use-case for it, but if they exist, the new mappings might break existing code.

Getting back to this, I think we shouldn't make the change from inner classes to SimpleXxxxProperty objects proposed by
this PR.

As for whether we should consider changing some internal instance of SimpleXxxxProperty (which I think wouldn't run
afoul of the hypothetical problem raised by @kleopatra ), we could file a new Enhancement request if you like, but it's
probably not all that critical, unless we were to find a few in the base Node or Control classes that could yield big
savings.

-------------

PR: https://git.openjdk.java.net/jfx/pull/141


More information about the openjfx-dev mailing list