Features
- Cover Type: Paperback with 487 pages
- Published by: Apress
- Edition: 2nd Edition December 20, 2007
- Written in: English
- ISBN 10 Number: 1590599098
- ISBN 13 Number: 978-1590599099
-
Book Dimensions:
9.1 x 6.9 x 1.1 inches
- Weighs: 1.8 pounds
Product Description
Backed by a tireless development community, PHP has been a model of language evolution over its 10+ year history. Borne from a contract developer’s pet project, these days you’ll find PHP powering many of the world’s largest web sites, including Yahoo!, Digg, EA Games, and Lycos.
PHP Objects, Patterns, and Practice, Second Edition shows you how to meld the power of PHP with the sound enterprise development techniques embraced by professional programmers. Going well beyond the basics of object–oriented development, you’ll learn about advanced topics such as working with static methods and properties, abstract classes, interfaces, design patterns, exception handling, and more. You’ll also be exposed to key tools such as PEAR, CVS, Phing, and phpDocumentor.
What you’ll learn
- Write solid, maintainable code by embracing object–oriented techniques and design patterns.
- Create detailed, versatile documentation using the powerful phpDocumentor automated documentation system.
- Gain new flexibility during the development process by managing your code within a CVS repository and using the Phing build system.
- Capitalize upon the quality code of others by using the PEAR package management solution.
Who is this book for?
PHP developers seeking to embrace sound development techniques such as object–orientation, design patterns, testing, and documentation
Related Titles from Apress
- Beginning PHP and MySQL: From Novice to Professional, Third Edition
- Pro PHP: Patterns, Frameworks, Testing and More
- Beginning Google Maps Applications with PHP and Ajax: From Novice to Professional
About The Author
Matt Zandstra has worked as a Web programmer, consultant and writer for a decade. He has been an object evangelist for most of that time. Matt is the author of
SAMS Teach Yourself PHP in 24 Hours (three editions), and contributed to
DHTML Unleashed. He has written articles for
Linux Magazine and Zend.com. Matt works primarily with PHP, Perl and Java, building online applications. He is an engineer at Yahoo! in London.
Matt lives in Brighton with his wife Louise, and two children, Holly and Jake. Because it has been so long since he has had any spare time he only distantly recollects that he runs regularly to offset the effects of his liking for pubs and cafes, and for sitting around reading and writing fiction. Learn more on Matt's website, getInstance.
Reader ReviewsI've owned PHP Objects, Patterns, and Practice for over a year, and it's still one of those books I go back to. It's a well written, generally well executed book on what constitutes Object Oriented Programming in the PHP5 environment. First, the good news: This book is a crash course on OOP design and thought. It borrows heavily from two monumentous texts in the field - the Gang of Four's book, and Java Enterprise Patterns - and condences their essences into an easy to swallow form. The basics are all here: how to create well designed classes, how to instantiate objects, etc. There's a hidden gem in the introductory portion of the book: the Reflection API. This API is built into PHP, and gives the coder unparalleled access to the guts of the classes and objects in a given project. It definitely has its uses. The patterns are all generally useful, with the only exception perhaps being the Interpreter pattern. I'm just not convinced that creating one's own command line interface syntax is necessary, given that PHP projects aren't usually interactive. It seems like something best left to an appendex, or extra web content. Now, for the bad news: Some sections of the book, especially some of the code examples, could've used a better editor. Small things, the kinds of things that can trip up inexperienced coders, crop up. Using private properties instead of protected. Using the wrong variable name between examples. That sort of thing. There's also a lack of a satisfying conclusion, so-to-speak. Zandstra himself claims that generating objects is perhaps the hardest thing to demonstrate. Yet, most of his examples (excepting the patterns late in the book) are canned. Objects and classes exist only to drive the theory behind a pattern home. Few real world examples are given. Admittedly, some patterns are simple to transfer to a real project, but concrete examples of that nature could serve to further cement his point. For example, it's not difficult to see how the Composite pattern would work well for dealing with an XML document, but would there ever be a need for a Visitor object to act on one? Finally, and in continuation of my last criticism, Zandstra never touches one of the things PHP is used the most for: form handling. Can forms be represented by classes? Could forms be generated by objects (perhaps using a Factory pattern)? What about form validators? Wouldn't the Strategy or Decorator pattern work? Supplementing his online Civilization game and CLI/quiz examples with this would've really put the book over the top. Still, with that said, PHP Objects, Patterns, and Practice is still a text that gets far more right than wrong. It's definitely a must-buy for those PHP coders looking to write modular code.