pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Martini <sandro.mart...@gmail.com>
Subject Re: Text validators
Date Mon, 20 Jun 2011 13:22:25 GMT
Hi all and thank for the suggestions ...

> why not go with full blown jsr 303? :-)
> http://incubator.apache.org/bval/cwiki/index.html
yes, could be a good long-term thing, but I think it's too much heavyweight
...

At least we could start, as Andrei suggested, as a separate subproject
(under /skunk or maybe if someone other is interested too maybe under
pivot-stuff), but later (2.1 or later) I'd like to have in core Pivot only
interfaces (and max implementations for most common ones) and go with a SPI
interface like in Pivot-JFree, ok ?

>I have no objection to adding some common validators - I'm a big fan of the
"comes with batteries" approach of projects like Python.
Good, me too.
>I prefer specific interfaces that do exactly one thing, rather than overly
general interfaces without type safety.
To avoid this maybe we could think (all for the 2.1) to change the signature
of validators, using T generics instead of Strings (and keep Strings in the
provided validators) so nothing should change by default.
But anyone need a more generic solution (and I hope someone will need) could
use it, ok ?


On the validation of Forms I know it's a complex thing, so my proposal to
add only the ability inside Form to set a validator (maybe called
FormValidator but could not only be limited to Form ... why not
ContainerValidator) and provide standard only interfaces (and the minimal
set of related classes, like ValidationMessage to contain a validation
message, ValidationContext or similar to interact with the container, etc),
like what is currently done in JSF.
The Skin could handle a default way to show validation messages ...
But put the rest outside Pivot. And let application designers to call it
if/when needed and choosing what to do (traversing all its components and
call attached validators, or do something inside that method, etc).

What do you think ?


The ticket is this (put as brainstorming):
https://issues.apache.org/jira/browse/PIVOT-761


Bye,
Sandro


--
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/Text-validators-tp3078385p3086178.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.

Mime
View raw message