Vous voulez voir cette page en français ? Cliquez ici.

Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Object-Oriented PHP: Concepts, Techniques, and Code [Paperback]

Peter Lavin
4.0 out of 5 stars  See all reviews (1 customer review)

Available from these sellers.


Join Amazon Student in Canada


Book Description

June 12 2006 1593270771 978-1593270773 1

Object-Oriented PHP shows developers how to take advantage of the new object-oriented features of PHP. Working within the context of concrete examples, the book begins with code compatible with PHP 4 and 5, and then focuses on object-orientation in PHP 5. The author's practical approach uses numerous code examples, which will help developers get up to speed with object oriented PHP quickly, and show them how to apply what they learn to everyday situations. All code samples are available for download on the book's companion site.


Customers Who Bought This Item Also Bought


Product Details


Product Description

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).


Inside This Book (Learn More)
First Sentence
Creating a web page ain't what it used to be. Read the first page
Explore More
Concordance
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Reviews

5 star
0
3 star
0
2 star
0
1 star
0
4.0 out of 5 stars
4.0 out of 5 stars
Most helpful customer reviews
Format:Paperback
I purchased Peter Lavin's OBJECT ORIENTED PHP and began reading it while I sat at my keyboard. After a few chapters I quickly realized that PHP's OO approach is similar to Java's, but easier because PHP is loosely typed. Although I followed the book for a couple of chapters, creating classes that form the basis of an online Photo Gallery, I quickly got side-tracked into creating the kinds of classes I might actually end up using in future projects.

Within a day I'd created a handful of classes for the common functions required in any interactive Web application: an SQL QueryBuilder class, a UserManager class, and a LoginManager class. This is the power and primary benefit of an OO approach. The code is modular and reusable. Data hiding through encapsulation and a combination of private and public methods (functions in PHP), make the creation and using of classes an investment in the scalability and maintainability of current projects, but also in future productivity.

Lavin's book is very good but has some structural problems. The first three chapters do not engage the neophyte Object Oriented developer, but instead focus on the intricacies of the Object Oriented framework as deployed in PHP; almost like a 3-chapter changelog. The first hint that Lavin is actually aiming at an audience unfamiliar with Object Oriented concepts is chapter 4. Despite that, once the book gets going the approach is straightforward and easy to understand. The project that forms the hands-on learning component is quite useful and illustrates both Object Oriented concepts and the full iterative nature of Object Oriented development quite nicely.
Read more ›
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 3.9 out of 5 stars  18 reviews
49 of 50 people found the following review helpful
3.0 out of 5 stars A Knowledge-Transfer Brief for PHP Programmers Aug. 27 2006
By Michael Ernest - Published on Amazon.com
Format:Paperback
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.
15 of 15 people found the following review helpful
3.0 out of 5 stars Generally Disappointing Dec 31 2007
By John R. Cornell II - Published on Amazon.com
Format:Paperback
From the perspective of a an experienced procedural PHP programmer learning OO, having read both this book and "PHP 5 Objects, Patterns, and Practice" by Matt Zandstra, I would definately recommend the latter to this book.

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.
13 of 16 people found the following review helpful
5.0 out of 5 stars What Object-Oriented PHP Programmers Are So Excited About July 21 2006
By Diane Cipollo - Published on Amazon.com
Format:Paperback
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.
3 of 3 people found the following review helpful
3.0 out of 5 stars a little too basic.. Aug. 24 2007
By D. Billeci - Published on Amazon.com
Format:Paperback
I consider myself an advanced PHP user, I have read a few other PHP books, but I'm always looking to learn something new in the field. This book definitely is for beginners. Up to chapter 9 and so far we've learned not much except how to resize an image and handle multi-page navigation. Chapter 10 (out of 16) deals for the first time with static variables and connecting to a database. There is a brief section on patterns which covers 1 (yes one) pattern, the singleton. Anyways, this book is not bad, it's well written just don't expect to learn much new if you are a seasoned PHP programmer.

I would recommend "PHP 5 Objects, Patterns And Practice", Zandstra, if you are looking for advanced coding techniques.
2 of 2 people found the following review helpful
2.0 out of 5 stars Probably not the most time effective way to learn OO PHP Aug. 29 2009
By Ted Spradley - Published on Amazon.com
Format:Paperback
I have used PHP procedurally for several years, and had some inkling of OOP, but no formal introduction yet. I was happy with the three introductory chapters laying the groundwork for the body of the book. I was also able to implement the classes developed as examples in this book with some added/modified methods. The author is a highly talented programmer and gives the reader an insight into his use and development of meaningful classes. The back cover presents this effort as an introduction to Object Oriented Programming, and fair enough, the concepts are clear. The summary also presents this as an 'easy to follow' guide to OO PHP. Not. It is one thing to sit in your recliner and read text and say, "Uh huh. Got it" and quite another to actually understand how to build the examples and implement them so that your time is not wasted.

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.
Search Customer Reviews
Only search this product's reviews

Look for similar items by category


Feedback