RE: [PHP] Classes - Dumb question

2007-10-15 Thread Jay Blanchard
[snip] With a class you can inherit all of the base class functionality into a new customer type. You do not have to break open the base class to add a case, you just have to create an extension class. Documentation is unique to each class. No matter what, you have to break something open to

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] With a class you can inherit all of the base class functionality into a new customer type. You do not have to break open the base class to add a case, you just have to create an extension class. Documentation is unique to each class.

RE: [PHP] Classes - Dumb question

2007-10-15 Thread tedd
At 5:42 AM -0500 10/15/07, Jay Blanchard wrote: [snip] With a class you can inherit all of the base class functionality into a new customer type. You do not have to break open the base class to add a case, you just have to create an extension class. Documentation is unique to each class. No

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, tedd [EMAIL PROTECTED] wrote: I understand the class concept. But, I am not familiar with autoload. Stut also made mention of that, so I shall investigate post haste. __autoload is pretty tight; but if you dont want to have all your class files in the same directory, i suggest

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Larry Garfield
On Monday 15 October 2007, Nathan Nobbe wrote: On 10/15/07, tedd [EMAIL PROTECTED] wrote: I understand the class concept. But, I am not familiar with autoload. Stut also made mention of that, so I shall investigate post haste. __autoload is pretty tight; but if you dont want to have all

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, Larry Garfield [EMAIL PROTECTED] wrote: On Monday 15 October 2007, Nathan Nobbe wrote: On 10/15/07, tedd [EMAIL PROTECTED] wrote: I understand the class concept. But, I am not familiar with autoload. Stut also made mention of that, so I shall investigate post haste.

Re: [PHP] Classes - Dumb question

2007-10-13 Thread Christian Hänsel
Jay Blanchard [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] [snip] First of all what you call normal is procedural or functional programming. There is nothing wrong with doing things this way and may be especially quick and efficient when doing basic web sites and

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Nathan Nobbe
On 10/12/07, Larry Garfield [EMAIL PROTECTED] wrote: On Thursday 11 October 2007, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Stut
tedd wrote: function customer($whatWas, $customertype, $whatAdditional) { /* do what was (i.e., common to all) */ /* then do what's additional unique to type */ switch(1) { case $customertype =='Commercial': commercialCustomer($whatAdditional); break; ..

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Nathan Nobbe
On 10/12/07, Jay Blanchard [EMAIL PROTECTED] wrote: No doubt. (are you by chance continuing the other argument, re: interfaces?), but you have to break open the original tested function, add code to it, test it, etc. Every time you add a new case you have to break open the existing function

RE: [PHP] Classes - Dumb question

2007-10-12 Thread Jay Blanchard
[snip] First of all what you call normal is procedural or functional programming. There is nothing wrong with doing things this way and may be especially quick and efficient when doing basic web sites and applications. Document well and you will have no problem maintaining your code. One

RE: [PHP] Classes - Dumb question

2007-10-12 Thread Jay Blanchard
[snip] Yes, but I could do that procedurally from within the customer function by simply adding a customer type (needed regardless) and using a switch to direct and collect the additional data needed. In either case, I still have to write more code to accommodate scaling. And, if I have

RE: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 7:36 AM -0500 10/11/07, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with classes, but now I

Re: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 2:44 PM +0100 10/12/07, Stut wrote: You can limit the need to add more code like so... function customer($whatWas, $customertype, $whatAdditional) { /* do what was (i.e., common to all) */ /* then do what's additional unique to type */ $func =

RE: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 9:03 AM -0500 10/12/07, Jay Blanchard wrote: tedd said: In either case, I still have to write more code to accommodate scaling. And, if I have more customer types, then it's a simple matter to add more customer functions and addition case statements to the initial customer function. I don't

[PHP] Classes - Dumb question

2007-10-11 Thread Christian Hänsel
Howdy fellas, okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with classes, but now I would love to know what makes the

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Jay Blanchard
[snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with classes, but now I would love to know what makes the classes so

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Robert Cummings
On Thu, 2007-10-11 at 07:36 -0500, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with

Re: [PHP] Classes - Dumb question

2007-10-11 Thread Jason Pruim
On Oct 11, 2007, at 8:36 AM, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with classes, but

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Jay Blanchard
[snip] Not trying to hijack the thread... Hopefully this is related enough, if not I apologize. Would a good use of a class be to write a generic database connection script? and then feed in the different variables, such as customer login, database, stuff like that? something like class

Re: [PHP] Classes - Dumb question

2007-10-11 Thread Larry Garfield
On Thursday 11 October 2007, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the normal functions all the time. I have never even bothered working with classes, but