Proposal: Deprecate Builders

Werner Lehmann lehmann at media-interactive.de
Tue Mar 26 03:21:29 PDT 2013


Same here. I like a convenient builder shortcut in some cases. In other 
cases, with some nesting involved, it does not work that good. Overall, 
I try to put as much as possible into FXML. Which btw seems to use 
builders for immutable classes like Color. Quoting the FXML docs:

> A default builder factory, JavaFXBuilderFactory, is provided in the
> javafx.fxml package. This factory is capable of creating and
> configuring most immutable JavaFX types. For example, the following
> markup uses the default builder to create an instance of the
> immutable javafx.scene.paint.Color class:
>
> <Color red="1.0" green="0.0" blue="0.0"/>

In the end we don't really depend on builders in our own code (the only 
hard dependency on a builder recently introduced to cover some OSGI 
classloader issue with a custom builder). It would be nice to have some 
easy (Eclipse) refactoring to convert the code...

Werner

On 25.03.2013 22:15, Rick Walker wrote:
> Richard,
>
>> and when considering Mobile / Embedded use cases, the extra cost of the
> builders is prohibitive
>
> We will have no hesitation in pruning all builders from our codebase. We
> use them mainly as a convenient shorthand for creating transitions but if
> it helps to create a leaner mobile stack I am all for deprecation/removal.
>
> Rick


More information about the openjfx-dev mailing list