What are the benfits of using php classes?

Status
Not open for further replies.

matthew1471

New member
May 13, 2007
242
0
0
Bournemouth, UK.
At the moment, my site is put together by having a different php file for each section/component.

When a certain section is required, the relevant php file is included by using include('section.php')

For example, if you look at Compare prices, save money and read user reviews on thousands of products at pricebeep.co.uk

the "newsletter", "order search results", "highest rated / most popular", the search results themselves, the search tags, the search bar at the top of the page, the header, the footer are all external php files, included when required.

I'm about to start a fairly major overhaul of the site, and wanted know about the benefits of using classes.

The new site will add "refine by price", refine by brand etc. Which at the moment are in (you guessed it...) external php iles.

Would it be worth my moving most of these external php files into classes held in one big php file?

Are there any speed considerations for using classes?

Is this even the right way to go about using classes?!

Cheers.
Matt.
 


Classes themselves would not make it any easier for you (especially not when used as one big file, holy shmoly). I suggest you learn something about OOP design, application architecture, URL routing etc. But on the other side, don't be too anal about these things - just use what suits you best and what gets the job done... the learning curve on these things can be a bit steep.
 
It's not about classes or not classes, OOP is a complete programming paradigm, you should read more about it, the PHP implementation is just that: an implementation.
 
Status
Not open for further replies.