Validation Support
Robert Lichtenberger
r.lichtenberger at gmail.com
Mon Mar 4 07:13:04 UTC 2024
First off, as the original author of ValidatorFX I feel flattered by the
suggestion of including it into the JavaFX core :-).
Some thoughts / insights I gained from developing ValidatorFX:
* ValidatorFX is (with the possible exception of GraphicDecoration.java)
rather trivial code and also very small (< 1k lines of library code).
But it seems to have filled a market gap according (a few thousand
unique ip downloads every month, issues from ca. a dozen people so far,
even a few PRs). These "market gaps" get filled rarely because they are
not a commercially attractive opportunity. On the other hand if you
decide (like I did with ValidatorFX) to take your closed source solution
and make it open source, you are "rewarded" by increased overhead at
first. But the market gaps exist and hinder broader JavaFX adoption.
* ValidatorFX is probably only one part needed for application
developers. The other part is a form library that allows to layout
fields, have buttons (that are connected to field validation, etc.). It
looks like this is written again and again by every application developer.
* To answer John's question if JavaFX could do more to help make tools
like ValidatorFX easy to build:
** There's the TooltipWrapper class in ValidatorFX which works around
JDK-8090379. Not a big deal but something many application developers
will probably be annoyed by.
** On a more general note, if I were the king of the JavaFX universe for
one day, I would forbid anyone to make classes or methods final. As an
application developer I prefer to be able to tweak things easily, even
if they may break in the future (which they will anyway ...). Don't take
that decision away from me, it's patronizing. But I guess this is one of
those things that depend very much on which side of the equation you
are, so don't take my troll bait :-).
--Robert
Am 03.03.24 um 02:10 schrieb John Hendrikx:
> Hi Dirk,
>
> That is a very nice framework, and although I wouldn't be against its
> inclusion in FX, I'm more wondering if JavaFX could do more to help
> make tools like ValidatorFX easy to build.
>
> I'm not quite sure how one can use not having validation as an
> argument against using FX, when there clearly are free alternatives
> available. Surely not everything can or should be part of the base
> framework? A line must be drawn somewhere, especially when there are
> very few core FX developers.
>
> I'd much rather see work being done on things that can't be provided
> by 3rd parties, preferably by opening up more parts of FX with well
> specified API's.
>
> --John
>
> On 01/03/2024 11:59, Dirk Lemmermann wrote:
>> Hi everyone,
>>
>> I updated the validation framework ValidatorFX today in our project
>> to the latest release and I really like it a lot. It is a small
>> compact API and works with any observable as opposed to the
>> validation support provided by ControlsFX.
>>
>> Using it made me wonder whether it would make sense to bundle it or
>> something like it directly with JavaFX. Developers often mention
>> missing validation support as a drawback of using JavaFX. Adding this
>> would take one item off from the list of arguments against using JavaFX.
>>
>> Many UI frameworks do have built-in validation support, e.g. Vaadin
>> [0], Angular, [1], or QT [2]
>>
>> What do you think?
>>
>> —Dirk
>>
>> [0]
>> https://vaadin.com/docs/latest/binding-data/components-binder-validation
>> [1] https://angular.io/guide/form-validation
>> [2] https://doc.qt.io/qt-6/qtquick-input-textinput.html
>>
More information about the openjfx-dev
mailing list