Classes: how best to connect them to other code?
Posted: Wed Jul 03, 2002 8:03 am
Hello everyone,
I'm taking my first steps in PHP programming and now it's time for my first 'real project'. Rather than code everything in the (few) pages I have to create - I'm thinking of using a Object Oriented approach.
My question is where should I keep my classes? I saw somewhere an example where the classes were all put in a single fleh.inc file and included at the start of each page.
I guess I might create something like 10 classes and am wondering if I should have them all in one file and include it in all my pages - or if I should group them together in 5 files (or so) and include only those containing classes that I'll need for each page.
NB. I haven't started any real design yet, the project is still only in my head but I'd appreciate tips on how you'd do this.
The balance in my mind being between simple coding and minimal load on the server. Does it affect the server noticably to include uneccesary lines of code?
Any suggestions?
Thanx, Toro
I'm taking my first steps in PHP programming and now it's time for my first 'real project'. Rather than code everything in the (few) pages I have to create - I'm thinking of using a Object Oriented approach.
My question is where should I keep my classes? I saw somewhere an example where the classes were all put in a single fleh.inc file and included at the start of each page.
I guess I might create something like 10 classes and am wondering if I should have them all in one file and include it in all my pages - or if I should group them together in 5 files (or so) and include only those containing classes that I'll need for each page.
NB. I haven't started any real design yet, the project is still only in my head but I'd appreciate tips on how you'd do this.
The balance in my mind being between simple coding and minimal load on the server. Does it affect the server noticably to include uneccesary lines of code?
Any suggestions?
Thanx, Toro