Proposal: Deprecate Builders
tbee at tbee.org
Tue Mar 26 01:01:49 PDT 2013
On 2013-03-26 08:07, Richard Bair wrote:
> I don't know, I'm not a language expert either, I'd have to try it out and see :-). However it does look like it is just pushing bits around w.r.t. builders. That is, it introduced a new Abstract class per concrete type, and the withers are basically like the methods we had. So even in the best case where it solves the problems, we still have a lot of additional classes in the hierarchy.
True. The additonal classes are there to not pollute the end leaves with generics, but the amount of code in the sum of both classes stays the same. But in the end you of course need something to provide the fluent API. The advantage here is that the overhead is minimal; there are no whole builder constructs needed, just two line methods adding the sugar.
> The way to try out the compatibility issues is to just have two projects -- one with a minimal hierarchy (A and B is sufficient where B extends A). The other project just has a main method which creates an instance of B and initializes it. Then make various changes to the A / B API and try running the main project unmodified (i.e.: not recompiled) and see what happens! Richard
I can do that. :-)
More information about the openjfx-dev