Re: Object Oriented Programming question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ben,
	I use a combination of procedural and OOP in my scripts.  It depends on my needs.  As an example, I use OOP for gathering order information.  I created a class which gathers all the order information allowing me to easily access any piece of data in the order.  I could do this with a bunch of individual functions but it's easier and more logical to group them all together in a single class.  When I first started working with classes, I used them sparingly.  Now I find myself using them more and more.

Take care,
Floyd

On Jan 19, 2010, at 10:11 AM, Ben Stones wrote:

> Hi,
> 
> I've been learning about object oriented programming for the past few weeks
> and I've understood it pretty well, but I have one question. Usually with
> PHP scripts I make, all the functionality for a specific page is in the
> actual PHP file, and I'd use PHP functions in a separate directory which
> would be included in whichever PHP file needs specific functions I have
> created. The functions would be for the specific things in my script, such
> as validation checks, functionality that will be used/repeated a lot
> throughout my script, etc. What I don't understand about OOP is what its
> primary purpose is for. Do I use OOP for all the functionality of my
> application, in separate directories, and include these specific class files
> and call the methods to complete specific functionality needed for whatever
> PHP file I'm working on, or is OOP used for specific functionality like I
> would with functions? Essentially what I'm asking is what is the primary
> purpose for OOP? Hope you understand.
> 
> Thanks,


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux