I have a project (PHP 4) in which I have 3 different classes: Database, Validator and Authorize.
Every class have its own responsibilities, but some times, I'll need the classes to work together.
An example:
I'll check if a user have logged in. Therefore I'll use the Authorize-class. But I'll have to connect to the database to check if the user exists. And I'll have to use the Validator-class to check if the user-submitted information is correct.
So I can't create the Authorize-class by extending it from the Database-class because I'd still need the Validator to control the data handled by Validator-class.
How do I do it?