Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   learning OOP in PHP (http://www.go4expert.com/forums/learning-oop-php-t436/)

Mike 4Sep2005 12:31

learning OOP in PHP
 
Hi,

This post is not meant to flame OOP'ers.

I'm trying to learn OOP (PHP4), but I'm having a hard time getting why OOP is more reusable than my procedual functions.

I use a "functions.php" file where I have stashed all my functions, connect to db, resize an image... and so on.

How would i write the following code using OOP, and make it more reusable?

shabbir 4Sep2005 20:37

Re: learning OOP in PHP
 
All Database related to one class, image related in other class. mail related in other ... This way you can use some of the existing classes to gain more stability.

Mike 20Sep2005 19:50

Re: learning OOP in PHP
 
Thanks

zerofill 7Oct2006 14:21

Re: learning OOP in PHP
 
Quote:

Originally Posted by shabbir
All Database related to one class, image related in other class. mail related in other ... This way you can use some of the existing classes to gain more stability.

Well there is also those but you also have to know OOP is much cleaner aswell as it is much easier to develop upon, if for example you have 2-3 people working on your site you can ask them to make classes and function and from there you can grab those functions within the classes to do some process.

OOP is much easier to understand and also everything is centralised.


All times are GMT +5.5. The time now is 10:13.