Re: OOP in web development

From: Date: Tue, 13 Feb 2001 20:41:31 +0000
Subject: Re: OOP in web development
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39485@lists.php.net to get a copy of this message
In article <5.0.2.1.0.20010213093835.00b339e0@mail.wizaerd.com>, "Joe Sheble (Wizaerd)" <JustForMailingLists@wizaerd.com> wrote: depending on the nature of what you are doing, one of the things that i like about using classes is the ability to group functionality under a larger structure, the class. Instead of having a series of disconnected functions, i can instead write them as class methods. another feature that is a basic feature of oop stuff is the idea of inheritence. So you can have a base class (CAR) that defines behaviour common to all instanaces of that class (var wheels, var door, method car start, method car turn signal on, etc...) Then you can subclass the CAR class to define specific behaviour for a particular car model (SPORTSCAR - var turbo, method car turbo on, etc..). again, depending on what you are doing, this can be very beneficial. I suggest you start small and also take a look at other people's code. You will find alot of classes out there that make alot of sense and can give you ideas of new ways of doing things.... Jeff > 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? > >

« previous php.general (#39485) next »