oop should be used when you want to create things to manipulate in your
program that are of a consistent structure. A simple example I use is for
company contact details and addresses. By creating a contact class I can do
...

include("path/contact.pc");
$thiscontact = new contact("company_code");
// and then
$thiscontact->display();
$thiscontact->save();
$thiscontact->delete();
// etc.

the class methods take care of all the mysql data gathering so you don't
have to worry about it after you've written the class. If your data
structure changes (or even the name of the database or server) just change
the class definition.

What I wouldn't use classes for is collecting variables together (use
associative arrays).

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
> Sent: 13 February 2001 16:42
> To: [EMAIL PROTECTED]
> Subject: OOP in web development
> 
> 
> I've been using PHP for over a year now and have been 
> successfully running 
> three different websites developed with PHP, but I've never 
> done anything 
> with classes or objects.  Even when returning data from a 
> mySQL database, I 
> use mysql_fetch_array() instead of mysql_fetch_object().
> 
> What am I missing by not using objects and classes, other than 
> reusability?  What are the real benefits to using OOPs in PHP?
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to