[thelist] OOP Validation Classes in PHP

Jay Blanchard jay.blanchard at niicommunications.com
Mon Sep 22 08:26:37 CDT 2003

I'm still approaching it from a very procedural manner, but the idea of
using the classes is something that seems to make sense, as long as I
can write them in a way that allows them to be reusable from project to
project (of course, that's the whole point).

I can't seem to find a lot of resources for OOP in PHP. A lot of the
stuff deals with creating things like calendars, and not validation
processes, which is what 95% of my projects require, so I'm kind of
guessing at a lot of this right now.

http://us3.php.net/oop is a good place to start, plus there are a couple
of excellent books on OOP. A Google search
turned up tons of information.

You are better learning general OOP practices and then applying those
practices to PHP (which will be getting more advanced OOP features in
PHP5, available as a unstable dev versions now if you want to play with

One thing to note, you seem to have developed several seperate classes
for a singular object. Taking a sales contact, for example, you would
want a sales contact class that describes those contacts as completely
as possible. The class then can be extended for unique cases. It is a
matter of preference generally.

More information about the thelist mailing list