RE: Classes - Dumb question

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

 



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 see the benefit in using a
class. At this point, it just looks like a different way of doing
things.
[/snip]

No doubt. (are you by chance continuing the other argument, re: interfaces?)

No, I didn't really understand the argument anyway. An interface to me "currently" is what the user uses to trigger my scripts.

, 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 to add that case. After a while, say if you need to drop a customer type you would have to (not really, you can leave it there and never exercise the case) break open the original code and delete the un-used code. Any way that you slice it the original customer function becomes more and more like spaghetti every day. Documentation for the function has to change each time as well.

Every time you add more code, the documentation should change regardless.

Every time you add more code, you have to test it anyway.

Spaghetti is not caused by adding more code, but by poor design.

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 add code -- if nothing else, the script.

I do see and understand the methodology afforded by OOP, but, I don't see an overwhelming reason to use it. Maybe in my next decade of programming I'll get with the program. After all, I don't keypunch anymore and that's progress. :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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