Object-Oriented PHP: Concepts, Techniques, and Code Paperback – 15 Jun 2006
Customers Who Viewed This Item Also Viewed
Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.
To get the free app, enter your mobile phone number.
About the Author
Peter Lavin writes regularly on all things tech, from technology book reviews to web design, and runs a web development firm based in Toronto. He has been published in a number of magazines and online sites, including UnixReview.com and Doctor Dobb's Journal, and is a contributor to PHP Hacks (O'Reilly).
What Other Items Do Customers Buy After Viewing This Item?
Top Customer Reviews
As a PHP developer by trade I have a pretty good grasp of procedural coding, but OOP has been gaining more and more momentum in the PHP community and I felt I couldn't ignore it any longer.
This book was an absolutely perfect introduction to the concept, and quickly taught me all the ins and outs of creating classes and objects in an easy-to-follow, jargon-free way. Most importantly I now finally 'get' OO PHP, and can see how it will benefit me in future projects. This is something that numerous online tutorials just didn't convey to me.
The book is split into 16 short chapters, each building on the last to cover new concepts. Through the course of the book you build a web application which makes use of several user-defined classes which interact with one another. The classes you build range from a database access class to an image thumbnailing class to a record pagination class, all of which are highly relevant to most PHP coders. I found that this use of real-world examples really helped to cement the concepts in my mind, and also allowed me to see where I could extend, adapt or improve the classes for my own needs.
This book is best experienced by coding along with the examples so that you produce your own version of the application. This really helps to clarify things in your mind. You can also download all of the example code from the companion website to help you see where you are going.
I couldn't recommend this book more - if you're looking to quickly grasp the key concepts of object oriented PHP, and to start using it in your own code, then look no further.
The second let down is the complexity of the code. This is not a beginner book and anyone learning php should stay far away from this till they understand the majority of the language.
Finally at times you get the feeling that author has got a bit carried away with building his application. I sometimes felt like I was in science and the teacher had got wrapped up in a demonstration instead of actually teaching the class. There are several chapters where he simply further increases the functionality of his application without bringing anything new to the table.
Saying all this it does provide a good introduction to the topic of OOP with PHP and with the numerous examples you will find yourself learning about the topic. Is it worth £20? No. Either borrow it or try to get it for half the price.
Most Helpful Customer Reviews on Amazon.com (beta)
It is a terse and sometimes bumpy ride. The book's conversational tone is appropriate for fellow geeks, but I found it more distracting than reassuring. There are some summary apologies, for example, that make the chapters seem like they were transcribed from tape. Rather than go back and match the introductory objectives to the text, a summary or two admits things didn't quite work out as planned. Ok, let's say there was no time to fix it. How does calling attention to it help?
Because the book is so short, the author glosses many concepts, frequently referring to web sites for technical details and tutorials. Once or twice he refers to a well-known author (e.g., Bruce Eckel) to support a complex point. Again while this is appropriate for a peer audience, it also needlessly puts the book out of reach for some readers.
It seems to me the book once had a too-ambitious outline. The back cover states you'll learn to "Incorporate AJAX into your OO PHP code." The coverage on this topic is trivial: an eight-line paragraph that names a website from which to retrieve example code, followed by indicators in subsequent to show where the AJAX reference is. The reader would be right to feel misled.
This book should be useful to the author's PHP peers, but those same readers should understand OOP well beforehand. I doubt a skeptical or demanding reader will like this book. Beginners will almost certainly get lost early and often.
Just because Zandstra's book doesn't have a cartoon on the front, doesn't make it less accessible. In fact I found it both more advanced and easier to understand at the same time. I imagine Lavin writing this book one chapter at a time, writing each successive chapter based on what he forgot in the previous. Zandstra's order of explanation on the other hand I found invaluable and thoughtful. When you're trying to make sense of a system by reading about it in a linear (book) explanation, the order in which the information is introduced and its context is very important.
Zandstra's book is also more thorough, and seems to approach implementation from an enterprise (read proper) perspective.
Lavin spends a lot of time on an example of using OO to build a system to display images in a directory. In hindsight, it turns out the design of his code is flawed in some places. Introduction material is no place to be teaching bad habits of any kind.
This book is $10 cheaper than Objects, Patterns, and Practice, but I think if you're serious about learning OO in PHP the extra $10 is worth it for a higher quality book.
Lavin starts with an overview of object-oriented PHP and discusses several of its advantages. He then discusses the basics of object-oriented programming such as classes and inheritance and the specifics for this type of programming in PHP. Next, he teaches you how to write your first class. One of the nice things about this book is that the author starts with this simple example and, as you progress through the book, shows how to build upon, extend and reuse that simple class to do more advanced programming.
The first step is to extend this class into a directory item class that will list all the files in a directory or list just certain files as needed. Next, you will write a thumbnail class that will create thumbnail images on-the-fly that are reduce in dimensions and quality thus reducing the download time. The third class you write is a page navigation class, similar to that used by Google, that will control the number of items listed on a page and also the number of page links in the navigation. Finally, he shows you how these three classes work together and with CSS.
Next, Lavin discusses the MySQL database class and how it works with the MySQL database. He also covers inheritance and how that can be applied to simplify error handling. He then moves on to abstract classes, magic methods and how dynamic websites can benefit from the SimpleXML extension to work with RSS feeds and the SOAP extension for a website search engine. We all hate to document our programs and Lavin shows you how to use the reflection class to self-document your code.
Peter Lavin has a web development firm and writes for several publications including PHP Hacks. There is a companion website that contains downloads of all the code and working examples.
I would recommend "PHP 5 Objects, Patterns And Practice", Zandstra, if you are looking for advanced coding techniques.
It is possible to use this book to learn OO PHP, but only with great willingness to search far and wide for supporting documentation to items mysteriously introduced without explanation. I seriously doubt any reviewer that rated this effort highly, stepped through the code line by line, chapter by chapter, entering their own programming notes into their code and understanding each step.
For me, the time required to research all of the items introduced in each chapter to the point of knowing the 'why' of each step was excessive. A specific example of an item being introduced without proper explanation is the introduction of the 'Iterator' interface in Chapter 10. There is no mention that interfaces are part of the Standard PHP Library (SPL), or that the Iterator functions are listed there. At least, in the context of the chapter, that is how it read to me. No explanation of how we know the behaviors or properties. I found myself digging into PHP's C/C++ source code to understand subjects glossed over in the text of the book. Further reading at the end of Ch. 11, almost two chapters later, then referenced the fact that Iterator was a built-in function and where to find the info. A little deeper digging reveals that in fact, reference was made in one of the introductory chapters, ch. 3, p.14. The 'we won't deal with the details here, but the download files have the proper code' or the information is somewhere else does not seem reader friendly. This is the default method in this book, making it frustrating to extract the knowledge in a meaningful, time effective way.
I guess I have become spoiled to the books written by author Larry Ullman and hold other instructional texts to that standard. If Ullman introduces a concept, he covers the details and has every line of code actually IN the text of the book. The process of actually including the code, not just highlight snippets, evidently causes a more thorough thought process on the part of the author and results in clear, easily understood explanations rather than opaque references to behaviors and definitions that the reader must seek out.
It is great accomplishment just to write a book, and I am grateful to all authors and this one in particular for sharing his knowledge. The style of reading required, i.e. reading pseudo 'back to front' in various sections was somewhat disconcerting. My view is that if you already know Object Oriented Programming and probably already know PHP OOP and have a thorough knowledge of the SPL, this is a great resource. I believe if this book were re-packaged so that expectations for the content were different, it would be a 5-star book. The knowledge gained from stepping through is useful and lasting, and expensive time-wise.
Look for similar items by category
- Books > Computing & Internet > Computer Science > Information Systems
- Books > Computing & Internet > Digital Lifestyle > Online Shopping > Amazon
- Books > Computing & Internet > Programming > Languages
- Books > Computing & Internet > Programming > Languages & Tools
- Books > Computing & Internet > Programming > Software Design, Testing & Engineering > Design Patterns
- Books > Computing & Internet > Web Development > Web Design > Applications
- Books > Computing & Internet > Web Development > Web Scripting & Programming