6 of 6 people found the following review helpful
Not recommended for beginners trying to learn PHP OOP,
Verified Purchase(What is this?)
This review is from: PHP Object - Oriented Solutions (Paperback)
Over the past 8 months I have been teaching myself PHP and after deciding that I should start using an MVC framework I decided to purchase this book as a way of getting into OOP PHP. I am a recent computer science graduate so this was not the first time I had come into contact with OOP concepts. Unfortunately, I did not feel that this book did a good job of explaining the main concepts of OOP nor that the classes the author picked to be much help in explaining what is a difficult subject for newcomers to grasp.
The first 2 chapters cover all of the OOP theory and syntax used throughout the rest of the book. These chapters are very dense and move quickly with basic examples on each of the new concepts introduced. The author states that he does not expect the reader to understand everything in the chapters and that they should be used as a reference as they reader continues. I do not feel like this was a good decision by the author especially given that the following chapters throw you in at the deep end rather than slowly building complexity.
The following chapter has you building a Date class in which you are effectively wrapping existing PHP functionality in your own custom class. In so doing, the author spends a large portion of the chapter explaining the in-built DateTime and DateTimeZone classes in a great deal of complexity. Given that this chapter will for many be the first class that they create, all of this extra information only stands to muddy the already murky water. The author would have been much better off creating a basic class which did not involve introducing more complexity at an early stage.
The next 2 chapters are much the same, introducing us to the built in validation methods and the remote file connection functions. At least a third of each of these chapters is spent going through the minutia of the respective built in PHP functionality.
Chapters 6 and 7 are spent discussing XML and SPL iterators, whilst useful, these 2 chapters contain nowhere near enough OOP to warrant inclusion and are only covered as the final 2 chapters rely on them.
If you have stuck with it this far you are rewarded with what I believe to be the strongest chapters in the book. You are guided through building a class that outputs XML from a database and then extend upon class allowing you to create your own RSS feed. In doing the author covers implementing an interface, utilising different types of exceptions and extending a class. They succeed where the other chapters fail because they focuses only upon creating and testing the classes and not on introducing other PHP functionality.
I think these chapters highlights the authors main failings with this book, he should have concentrated on building complexity with classes that did not need any additional knowledge in order to make, gradually introducing OOP concepts as he went, rather than including them all in two very dense chapters at the start of the book.
In addition, I found the book to have a number of errors within the code, and the authors site, to which he refers throughout the book (friendsofed.com), is currently down, making the chapter on remote file connection particularly hard.
If you are looking for a gentle introduction to object orientated PHP this book is not for you. It got complex much too quickly and spent as much time explaining complex inbuilt PHP functionality than it spent on teaching you OOP. Unfortunately, I do not know of a book that does a better job but I'm sure there must be one out there, keep searching...