>I want to point something out to aspiring authors. The truth is, that few >books and web pages out there show examples using OO methods. For example, >the book I use as my primary reference has one chapter on OO PHP and that >is it. The rest of the examples in the book are in regular functions. And >the one example they give is used to create a web page, with the Title , >KeyWords, Styles, Header, Menu... as the objects. > >So, I guess my point is that if people want to encourage use of OO >programming, they need to use more examples in their books instead of what >is "easy." Otherwise, if the reader doesn't "get" the one example, they >don't have other examples to try. Furthermore, one cannot encourage people >to think about how they can program using OO methods if they don't use such >methods in their teaching of the subject matter.
Basically, a "Simple OO Example" is an oxymoron, or a Bad Example (apologies to Ralph Covert). OO really only shows its strength when you have a certain set of pre-conditions: 1. Multiple programmers working on large-scale project -- OO safely sub-divides functionality so that they can code with less risk of screwing each other up. 2. "Library" release code (eg PHPLib) -- OO allows you to have minimal impact on the main application's variables/constants etc by providing a separate name-space 3. "Real-World Object" being modeled in complex/interesting ways -- OO provides a more "natural" coding style for this in some cases. None of these pre-conditions is met in a "Simple Example" That said, there are a zillion PHP OO applications/solutions "out there" for you to look at. Some even have comments. A few even have *GOOD* comments. :-) It is entirely possible, however, that you don't even *NEED* OO for anything you're doing. If your project doesn't meet any of the above three pre-conditions, chances are Really Good that OO would be like swatting a fly with a cannon. You can do it. And if a cannon is all you know how to work properly, maybe that's the best answer. But it's usually not the "best" answer in a general sense. NOTE: I'm an old-school Lisp hacker. I *LOVE* Object-Oriented systems. Yet I rarely feel a need for OO in my PHP scripts. YMMV. -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php