- From: Hendrik Ebbers <
- Subject: Re: Builder(s)
- Date: Tue, 05 Feb 2013 23:00:12 +0100
I would vote for 2 classes and 2 builders because this is the way JFX is
doing all this stuff.
Any way you look at it, the resolution is not perfect if we only use one
builder class. But I think it's a big benefit to have the abstract
implementations because developers can simple create their own Datasources on
top of this classes. So in my eyes it's the lesser of the two evils to use
different builder classes.
Am 01.02.2013 um 09:40 schrieb
> 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
> (using ResultList(ObservableList)).
> 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
> list data
> All input is very welcome!
> - Johan