For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2005 > Re: [PEAR-DEV] Validate finally finished splitting up.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR-DEV] Validate finally finished splitting up.
Bertrand Mansion

2005-05-26, 8:59 pm

Helgi =DEormar wrote:

>Hello people.
>
>Now many of you might have noticed the flood of releases of Validate_*
>packages and must be thinking what's going on.
>
>To explain it in a short manner, we decided to make the main Validate
>package smaller and split of the locales (UK, NL, PL and etc) and the
>other things into their own sub packages so they can benefit from their
>own release cycle instead of relying on Validate to make a release.
>
>This will make it easier for new validate packages to emerge and also to
>define different stability states of each sub packages.
>
>We truly hope this benefits everyone, even tho it might mean a bit more
>typing for those people that need more than one locale ;-)


If your objective is to refactor the Validate package, you might want to ha=
ve a
look at how we use validation rules in HTML_QuickForm. We used the Strategy
pattern which makes it easy to add new rules and a Registry which loads onl=
y the
request rules on demand, checking if they have not already been loaded. It =
also
handles new rules registration.

Good luck,

Bertrand Mansion
Mamasam
Helgi Žormar

2005-05-26, 8:59 pm

On Sat, 2005-05-21 at 09:51 +0200, Bertrand Mansion wrote:
> Helgi Žormar wrote:
>
>
> If your objective is to refactor the Validate package, you might want to have a
> look at how we use validation rules in HTML_QuickForm. We used the Strategy
> pattern which makes it easy to add new rules and a Registry which loads only the
> request rules on demand, checking if they have not already been loaded. It also
> handles new rules registration.


Nahh the objective was to make the main package smaller really and make
the APIs consistent between locale packages, people do not use the main
Validate package to call the underlying (read sub packages) functions,
tho well multiple() function does some calling but not in the sense that
QF does it.

Plus the way QF does it, that would mean that I'd have to make a new
file for each rule, and same for every of the sub packages ... And than
we have a high count of files :)

If I'm missing something than by all means let me know.

Thanks for the input.

- Helgi
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com