This could be realized in a rather user friendly way by exposing these static factory methods all on one class for which the user can then use a wildcard import (e.g. import static marcono1234...FactoryMethods.*;).
As part of this, it might be reasonable to rename the existing builders (and their packages) to:
SerialBuilder: FluentSerialBuilder / LowLevelFluentSerialBuilder (possibly a bit too verbose)
The new builder API could be for now mostly be implemented on top of the existing fluent API. But eventually, especially for handle support, it might be easier to implement the fluent API on top of that new API. That would however also require a low level non-fluent API.
Currently the builder only provides a fluent API. While this has some advantages it also have some disadvantages:
Therefore it might be useful to also offer a non-fluent builder API, for example similar to this:
This could be realized in a rather user friendly way by exposing these static factory methods all on one class for which the user can then use a wildcard import (e.g.
import static marcono1234...FactoryMethods.*;
).As part of this, it might be reasonable to rename the existing builders (and their packages) to:
SerialBuilder
:FluentSerialBuilder
/LowLevelFluentSerialBuilder
(possibly a bit too verbose)SimpleSerialBuilder
:SimpleFluentSerialBuilder
(too verbose?) /FluentSerialBuilder
The new builder API could be for now mostly be implemented on top of the existing fluent API. But eventually, especially for handle support, it might be easier to implement the fluent API on top of that new API. That would however also require a low level non-fluent API.