I have a couple of classes, which each need each other. What would be the best coding practice to use them all together ?
- I have a template class (patTemplate)
- I have a database class (ezSQL)
- I have a configuration Class (patConfiguration)
- I have a self designed form class which extracts data from a db (using datbase class) and shows forms (using patTemplate). So the latter needs both other classes. The database class obviously needs the configuration class to retrieve some data from my config files (info about dbhostname, ...). What is the best way to construct this?
My objective is:
store config info in as little files as possible
store as much config info in config file and not in PHP code
* create as little objects as possible
BUT ...
they have to work closely together ... how can I achieve this ?