Extending builders: PathBuilder

Eva Krejcirova eva.krejcirova at oracle.com
Wed Nov 21 09:21:10 PST 2012

On 20.11.2012 15:46, Richard Bair wrote:
>> There is one part which is unclear: What to do, if BOTH elements() and new methods (moveTo, etc.) are used? e.g.
>> PathBuilder.create().elements(new MoveTo(10,10)).lineTo(100,100).closePath().build();
>> or
>> PathBuilder.create().moveTo(10,10).lineTo(100,100).elemens(new ClosePath()).build();
>> There are several approaches for this :
>> 1.) appending everything into one list so both of former examples return the same path.
> This was my natural inclination. Is it really likely that we would break anybody if we decided to treat all such methods (like children()) in this way, where they are additive? I mean, does anybody have a builder with two calls to children where they expected the second to replace the first? It seems maybe this is a place where the spec should be changed?
I didn't find any such usage in our code, but that doesn't mean that 
nobody does that...  What do others think?

More information about the openjfx-dev mailing list