|
From: Steven D. <ste...@gm...> - 2005-05-12 09:22:55
|
Thanks for the pointer Oliver. I couldn't find the declarative part of
Keith rules system in the sandbox but I guess it's a work in progress.
For me the declarative part is the most important part of a validation
tool. How the back-end is implemented is of minor importance to me as
long as it does restrict the validation functionality. The predicates
offered by commons collections are a perfect fit for me. It allows the
valang parser to return a common interface that's reusable elsewhere.
Based on Keith's wish list I feel valang currently fulfills them all
except the second to last:
* We want a framework that focuses on validating business
objects, not one that is coupled with the presentation tier or any
view, form, or controller technology.
Valang does this but implementing Spring's Validator interface.
* We want a framework that makes it easy to define new rules, and
makes rules top-level-objects that can be reused in other contexts
(and are not tightly coupled with the framework.)
Valang uses the Predicate interface from commons collections
and as such creates rules that are reusable elsewhere.
* We want a framework which supports expressions using relational
operators (<,>,<=3D,>=3D,=3D=3D,!), logical operators (and/or), and
conditionals to allow for the creation of semantic business rules in
addition to simple syntax checks.
The valang parser offers a range of language constructs that
go beyond these requirements and that will be extended over time.
* We want a framework that is capable of reporting rich,
internationalized validation results on rule evaluation.
Valang offers i18n support, thanks to feedback of C=E8sar Ordi=F1ana=
.
* We want a framework that is capable of generating typing hints
and other visual indicators for rules that constrain bean property
values to enhance an application's usability and overall user
experience.
I'm not sure what the requirements are but I'm sire this can be ad=
ded.
* And for the Swing crowd, we want something that works just as
well in a web-app environment as it does in a rich-client environment.
For me this is a duplicate of the first requirement.
Regarding the design goals I think valang also scores a number of hits:
* The design should make it extremely easy to define new rules
and integrate those rules into the rest of the framework.
I'm not sure if "rule" means an actual rule (ex. "age >=3D 18")
or an operator test. Adding rules to valang is extremely simple. The
way valang handles operator test is currenlty sub-optimal when it
comes to extending but this can be improved.
o To facilitate this, the design should decouple rule
evaluation from results reporting.
Valang does this.
* The design should cleary decouple the validation of values from
how those values are retrieved. This allows the value checks to be
more easily reused.
Valang retrieves bean values in one place. This mechanism is
currently not pluggable but this can also be improved, for example by
means of the visitor pattern.
o For example, the act of retrieving a bean property value
should be decoupled from taking that value and testing it against one
or more constraints. The constraints should have no knowledge of how
the value was obtained.
Valang does this.
* The design should provide pluggable rules sources. Initially we
plan to support programatically defined sources and commons-attributes
sources, but others such as xml-based or scripting based should be
possible.
Although the factory bean currently does not support this you
could for example provide your own predicate instance instead of
having them created by valang parser.
* The design should leverage Spring's existing infrastructure
where appropriate and should in general not re-invent the wheel.
I think valang currenlty does this but I'm sure there's room
for improvement.
* The framework should provide a library of out-of-the-box rules
and regularly integrate back community contributions over time.
Valang does this I think. I've incorporate all the feedback I
received thus far. Valang is currently scheduled for release with
spring modules 0.3.
In general valang isn't final yet. I'm happy to discuss with anyone
how valang can be improved. I'm also open to merge valang with other
initiatives for the sake of creating the most usable and flexible
tool. There currently aren't a lot of solutions available in
declarative validation land and valang is currently nothing more than
a attempt to provide a solution.
I thinks its strongest point is the parser that can be an alternative
to programmatic declaration. I keep extending the parser's
functionality and while we keep the discussion of how declarative
validation should be done alive we will have a strong evaluation
language available if and when we will have an outcome.
Steven
On 5/12/05, Oliver Hutchison <Ol...@ou...> wrote:
> Steven,
>=20
> > I didn't know Keith had plans for a declarative validation solution.
> > I'm looking forward to hear his ideas on the subject.
>=20
> Keith's already started work on his declarative validation framework!
> The code is in the sandbox's org.springframework.rules package. There's
> also a page about it in the wiki:
> http://opensource.atlassian.com/confluence/spring/display/DOC/Declarativ
> e+Validation?focusedCommentId=3D132
>=20
> From my (very brief) look at what you've done with Valang it appears
> there is a strong synergy between the 2 projects. Your functions and
> predicates packages have a lot of similarities with Keith's closure and
> constraint packages. I suspect that it wouldn't be hard to reimplement
> your Valang parser so that it generated Keith's Rules.
>=20
> Ollie
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_ids93&alloc_id=16281&opclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
>=20
--=20
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
|