Home Resources Object-Oriented Programming with PHP5: Learn to leverage PHP5's OOP features to write manageable applications with ease

April 28, 2010
6:30-9pm, TekSystems
Colorado Springs, CO

More Information...

Follow Us On Twitter

Object-Oriented Programming with PHP5: Learn to leverage PHP5's OOP features to write manageable applications with ease
Written by Asa Martin
Tuesday, January 27 2009 10:22
Cover image
Author: Hasin Hayder
Published: December 2007
Publisher: Packt Publishing
Reviewer's Rating: 3/5

This book covers an introduction to object-oriented programming, design patterns for php, reflection, unit testing, SPL, databases, XML, and MVC design. It is targeted for beginner to intermediate users. Being new to PHP but not to programming I found the book to be a great introduction to the language. In fact, I learned quite a bit in this read which I am sure will prove valuable in my future development. The author gives many examples and does a decent job explaining things as he moves forward. Another plus is the book is an easy read and not very long.

Unfortunately nothing is perfect and this book has some issues which are difficult to ignore. It is obvious that the author's first language was not English. He is able to convey his thoughts but the poor grammar should have been caught by the editor. I found this very distracting while reading. Another problem is while the author attempts to explain things in simple, plain language; he glosses over important points or is not clear enough in others. I realize this is knit picky but the end of his definition of the word "class" reads, "...sometimes in the book we will name an object as class, as they are both synonymous." Objects and classes are not the same thing and I feel that this distinction while not a major issue for new programmers should not be misrepresented. The last issue I will cover is in the design patterns section. He attempts to recreate the Singleton pattern which is one of the better known in development circles. While his code will work, it is not correct. He maintains a static instance variable properly but fails to protect the constructor by making it private. I am assuming from his example that the developer is supposed to call the constructor to obtain the singleton instance but by not protecting the constructor the php interpreter will create a new instance of the singleton object every time. The static instance variable will remain the same and the example will appear to work but in a real system this could become an issue as there are potentially multiple instance objects floating around on the heap waiting for garbage collection.

View more information about Object-Oriented Programming with PHP5: Learn to leverage PHP5's OOP Features To Write Manageable Applications With Ease at the publisher's site

Copyright 2010 Front Range PHP Users Group. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.