Re: Thoughts on QuickForm-additions (again)

From: Date: Sat, 16 Aug 2003 13:27:05 +0000
Subject: Re: Thoughts on QuickForm-additions (again)
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19890@lists.php.net to get a copy of this message
Hi! Stefan Neufeind wrote:
Hmm - but again this is not possible at all without braking the current API - or do you see a solution. And we can't break the Validate-API.
Well, as Pierre helpfully pointed out, Validate is still in alpha. The PEAR definition of alpha (http://pear.php.net/manual/en/faq.unstable-code.php): "early stages of development, all things could change (API, behavoir) without notice, expect lots of bugs" So we can break the API of Validate as we like.
Clarification: it was Bertrand who made changes to Validate, not me. And changing Validate to implement Strategy pattern is not an 'extension', but a 'complete rewrite'. We can discuss this, of course... :]
You surely know this is not possible. And talking again about a "ValidateAdvance" or "Validate2" or something is not a good idea either. Pierre is open for changes as long as they are reasonable and maintain BC.
Yes, Pierre is a very nice guy. I had enormous pleasure collaborating with him and proposing enhancements to the package he maintained. I am glad that you get along so well and hope that your help will be a great boost to Validate's development.
So do you have any suggestion?
Yes, scrap it and start over again.
Generally you're right, yes. But why can't you use both for the moment? I think of having an OO-validator as a wrapper for procedural validation-routines. This way we could integrate new OO-validators and at the same time use already existing validators (that are used by projects already) from Validate.
We can use them *now*. No need to bother with wrapping.
Good then. Well, and how can we make it even better? I think we should do changes to the validation-part to allow even more ways for validation (server *and* client side) "out of the box" (distributed with QuickForm / Validate / ... and not "you can surely write your own validators in your app if you have need"). Back to the example: minValue and maxValue are in my view quite vital - but can't be implemented using regex.
It is already possible to do minValue and maxValue using Validate::number() Haven't you looked at it?
Yes, and there were 2 proposals to make this registering automatic: 1) Doing registerRule() on Validate.php include like is done in HTML_QuickForm_file 2) Adding introspection API to Validate so that functions can be registered from within QuickForm Automatically registering Validate's methods within QuickForm without introspection API is not a good idea: you'll have to make changes to QuickForm each time Validate's API changes.
Didn't get that point completely. Could you make the different ideas maybe a bit clearer? Is it something on which you already decided or is it for discussion? And why do API changes (do you mean extensions - or your "rewrite" mentioned above) break anything?
Please see the previous postings in the thread. I am not going to repeat myself.
As for the client side, I'd like to see some actual code before saying something.
That's another open point. I guess we should base it on the "whole validation infrastructure". Meaning that if we decide to move things forward to use Validate, maybe do extensions to validate etc. we can talk about javascript-validation as well. At this point in our designs / additions / changes for Validate we should keep in mind that we need to consider JavaScript also - meaning: An open design. But I can't yet propose any "actual code" till the general things about Validate etc. are not ironed out.
I am not talking 'final' implementation. I am talking 'proof-of-concept'. Now show the code.
I hope we were clear enough why we don't generally want to add new features to HTML_QuickForm class itself? But we do gladly accept proposals and contributions, just look at the CVS logs.
That's how I got it. Not add it to QuickForm itself but maybe to Validate. And therefor we might find a way towards better validation- integration (including client-side).
Glad to hear that it has nothing to do with QuickForm for now.
There was no flaming neither involved nor intended. The discussion was mainly about concepts, how work can go on and even how Validate and similar packages can work together. So at the moment it was a general remark asking "where could additions like this be done".
So you are *not* going to produce code?
As Bertrand said: I want to end the discussion (my discussion) at this point.
Wow. Cool. I was getting tired of this, too.

« previous php.pear.dev (#19890) next »