On 15/03/11 18:34, Jeroen De Dauw wrote:
> Hey,
>
>  > Before we approach this from scratch
>
> Well, since Validator already exists (and IMO has proven very well how
> useful it is in some of my extensions), it's only building the second
> half of the bridge, not staring from scratch.
>
>  > Would it make sense for SMW to use Validator?
>
> I'd not be suggesting it if I did not think this was the case :)were

To clarify: my question was *whether* you were actually suggesting it. I 
don't mind the additional dependency or dependencies to SRF if the 
overall code is better and easier to maintain. My knowledge of Validator 
is limited though.

> The
> only real pain is the b/c (all extensions with query printers will have
> to be modified to work with such a new SMW) and the introduced
> dependency. Although I've not heard anyone complain about the later for
> any of my extensions (for over a year), as you can simply bundle
> Validator with any extension that required it in releases.
>
>  > Could this also simplify our code?
>
> The biggest win in simplification of existing code would probably be in
> the query printers. Also, making the query printers and non-ask parser
> hooks use Validator would add a bunch of stuff such as the earlier
> mentioned auto-documentation and error feedback for users basically for
> free, without adding any complexity to SMW whatsoever (as SMW will just
> define what the parameters are, and Validator can figure out for itself
> how to do things with them).

I think the object model for parameters would be a good fit for our 
printers. I do not quite understand how Validator groups parameters, or 
how it associates parameters with parser functions (does it?). In our 
case, we have multiple parser functions (#ask, #show) that refer to the 
query printers, but the expected parameters are defined by the printers, 
not by the parser function. On what level would something like 
documentation generation then happen (as we cannot generate a single 
canonical documentation for #ask)?

I also wondered if we can move input validation errors to our own error 
array which is reported in a tooltip in the page (together with any 
other query errors etc.).

- Markus

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to