- From: <
- Subject: Builder(s)
- Date: Fri, 1 Feb 2013 08:40:54 +0000 (GMT)
We are refactoring the datafx code, based on the feedback we got from
the 1.0 release.
There is an interesting area where we try to gather more input and
feedback, which I briefly describe here:
(External) data can be a single object or a list of objects. Currently,
(most of) the datasource implementations handle both cases. Since
ObservabeList and ObservableValue and their subclasses have only the
Observable interface in common, this means we have lots of duplicate
code in those implementations, dealing with either list or single
We plan to have different implementations for single objects and for
lists by having abstract classes that deal with most of the work:
AbstractDataSource and AbstractListDataSource.
We would then have something like SingleObjectDataSource and
ListObjectDataSource providing concrete implementations for parsing
external data into Java Objects.
The typical JavaFX approach would then add a builder for each of those
implementations: SingleObjectDataSourceBuilder and
However, that implies that the developer should use different builder
classes depending on whether he expect a single result or a list of
entries from the dataservice. In the current version, there is a single
builder class, ObjectDataSourceBuilder, that allows you to deal with
single object (applying ResultObject(Observable o)) or list objects
So basically, the question is: do developers want
1. a single builder class providing methods to distinguish between
single object data and list data
2. two separate builder classes, one for single object data and one for
All input is very welcome!