Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All fx builders are deprecated ... except a bunch in .adapter?

Never loved builders (and rarely used them), so not overly unhappy about the decision to deprecate them in jdk8 - but there's one package where they are not deprecated and in fact the only way to instantiate their products: the adapters to javaBean properties - bug or feature?.

Questions:

  • will they be deprecated as well in the final release?
  • if not, is there any reason they are safe to use, that is don't break binary compatibility?
like image 865
kleopatra Avatar asked Nov 01 '13 13:11

kleopatra


1 Answers

The adapter builders are separate from the "scenegraph object" builders. They do not subclass the NodeBuilder (parent for all other builders of objects related to the scene). The whole issue arose because the OpenJFX team decided to implement the Builders for all subclasses of Node with generics (in order to save byte code size and work) instead of a flat approach (which would be tedious to code, hard to maintain and huge in byte code size).

The builders for the adapters are "flat" builders, meaning the builders have no parent. Which is only natural and easy ,since you have builders only for roughly each "primitive" property type, and one for object properties, that reads getters and setter per reflection.

This means that there is no issue with adapter builders, they won't break binary compatibility. As to why they are exposed via builders only and if they will be deprecated is beyond me.

like image 64
Oliver Jan Krylow Avatar answered Oct 08 '22 01:10

Oliver Jan Krylow