Making the approach dependent on the order in which the mutators is called would be ugly. It would also be bug prone. Forget it just once and you might be wondering why the heck your code is misbehaving.
Perhaps the contructor could be modified. The current hashref would fall under a key named "params" and a different key named "groups" would list group validations. Then, as soon as an accessor is called, the "group" validations would be checked. This would eliminate the order dependence. Workable?
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
In reply to Re(4): RFC - Parameter Objects (validation)
by Ovid
in thread RFC - Parameter Objects
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |