Amazon.com Customer Reviews
A Better Title Would Be Implementing OOP In PHP - Review written on October 20, 2007
Rating: 5 out of 5
As other reviewers have stated, this is defiantly not a book that will teach you object oriented programming, nor, have I found a book that teaches all the concepts of OOP and how to program php in conjunction with one another.
I would recommend that if you want to learn OOP, then read the book "Head First Java" -- you will know OOP inside and out. From there, if you have a little procedural PHP under your belt, the syntax of Java and PHP are nearly identical.
If you already know OOP, but need to learn how to define classes etc, in PHP, this is an excellent resource and a good read.
echo 'Great Book!'; ?> - Review written on March 05, 2007
Rating: 5 out of 5
3 customers found this review not to be helpful.
This book is great whether you are an experienced coder or a beginner. I've been using php for a few years now, and i picked this book up, just to have under my belt, and wow. i learned a few things off of it. It really gets into PHP5 where the world of web should be headed.
A few key features, is, he gets deep into OO in PHP5, which is nice, and gives you examples and sample codes. Writes it like a pro, so anyone can follow a long. He even talks about a few items from the SPL. Like he said, PHP is a victim of its own success.
Good reference for getting started with OOP in PHP - Review written on September 08, 2006
Rating: 4 out of 5
17 customers found this review helpful.
I'll get this out of the way up front; I approached this book with a completely inaccurate perception of what it was going to give me. I would consider myself an intermediate to advanced php developer, and I was hoping this book would teach me awesome ways to use PHP5's OOP power to make my applications better, faster, and more attractive to women. That wasn't what this book does. This book introduces OOP, explains why it's useful, and goes through to develop several sample applications to demonstrate OOPs power, and more importantly how to use it.
The books pretty thin weighing in at 216 pages, split up amongst 15 chapters. The first bit of the book concentrates on explaining what OOP is, why PHP needs it, and why you want it. It then moves on to explain why OOP sucked in PHP4, what works better in PHP5, and all the fancy new words you're going to need to memorize to use it (protected, private, etc.). It then moves on to develop a sample indexing application, adding in thumbnail generation as the book progresses. Later on more advanced topics like design patterns, interfaces and exceptions are introduced. Finally the book gives a brief introduction to SPL which was introduced in PHP5 and improved in PHP5.1.
Overall I would recommend this book to beginner PHP developers, or intermediate developers who have not yet gotten their feet wet with OO.
A Knowledge-Transfer Brief for PHP Programmers - Review written on August 27, 2006
Rating: 3 out of 5
31 customers found this review helpful, 1 did not.
Object-Oriented PHP is really a technical brief that seems to fall short of its own ambitions. It covers PHP 5, most notably the radical switch from prior versions to a full OOP model. Lavin summarizes the reasons for the changes and reviews basic concepts of OOP. He then develops some classes for an application that draws images from a database and displays thumbnail images. In some places the PHP 4 equivalent code is provided for study. Notes on MySQL and PHP Data Objects (PDO) are also included.
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.
What Object-Oriented PHP Programmers Are So Excited About - Review written on July 21, 2006
Rating: 5 out of 5
12 customers found this review helpful, 2 did not.
Object-Oriented PHP by Peter Lavin is a good book for any traditional/procedural PHP programmer who would like to know what those object-oriented PHP programmers are so excited about. If you are considering adding object-oriented PHP to your toolbox and want a step-by-step, example based guide for the beginner, this is a good book to start with. This book is also for programmers who want to switch from PHP 4 to PHP 5.
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.