Skip to main content

Professional PHP Design Patterns

Professional PHP Design Patterns

Aaron Saray

ISBN: 978-0-470-49670-1

Aug 2009

288 pages

Select type: Paperback

Product not available for purchase


This guide helps PHP developers take advantage of the stability and features of design patterns

Design patterns are the cornerstones of building solid, stable, flexible, and feature-rich Web applications. This guide enables PHP developers to take advantage of everything they offer.

If you are unfamiliar with design patterns, this book explains what you need to know. Both novice and veteran PHP developers will benefit from the alphabetical list of design patterns and code examples showing how to implement each pattern in PHP. Step-by-step instructions for a sample contact management system will help you understand real-world applications for the information.

  • Gets PHP developers who have not used design patterns up to speed on the technology
  • Shows programmers who are familiar with design patterns in other languages how to apply the techniques to PHP
  • Includes examples of ordinary code used in everyday development and how to modify it for one of the design patterns discussed
  • Provides an alphabetical list of common design patterns, with code examples showing how each can be implemented in PHP
  • Uses a case study of a contact management system to analyze and demonstrate the step-by-step process of applying design patterns

With its single focus on applying design patterns to PHP development, PHP Design Patterns helps both new and veteran PHP programmers improve their applications and their career prospects.


Part I: Getting Acquainted with Design Patterns and PHP.

Chapter 1: Understanding Design Patterns.

Chapter 2: Using Tools Already In Your Arsenal.

Part II: Reference Material.

Chapter 3: Adapter Pattern.

Chapter 4: Builder Pattern.

Chapter 5: Data Access Object Pattern.

Chapter 6: Decorator Pattern.

Chapter 7: Delegate Pattern.

Chapter 8: Façade Pattern.

Chapter 9: Factory Pattern.

Chapter 10: Interpreter Pattern.

Chapter 11: Iterator Pattern.

Chapter 12: Mediator Pattern.

Chapter 13: Observer Pattern.

Chapter 14: Prototype Pattern.

Chapter 15: Proxy Pattern.

Chapter 16: Singleton Pattern.

Chapter 17: Strategy Pattern.

Chapter 18: Template Pattern.

Chapter 19: Visitor Pattern.

Part III: PHP Design Case Study.

Chapter 20: Requirements Analysis.

Chapter 21: Choosing Design Patterns and Planning.

Chapter 22: Programming the Application.

Chapter 23: Improving with More Design Patterns.


9780470496701: Professional PHP Design Patterns Code
ChapterPageDetailsDatePrint Run
16107Error in Code
In the source cod, the array $boughtCDs should have a key 'title' for value 'Long Road' and 'Waste of a Rib'.

The code should be like this:

$boughtCDs[] = array('band'=>'Never Again', 'title'=>'Waste of a Rib');
$boughtCDs[] = array('band'=>'Therapee', 'title'=>'Long Road');

164Error in Text
if ($array) {
if (!isset($_SESSION[$name])){
$_SESSION[$name] = array();
$_SESSION [$name][] = $value;

Should be:

if ($array) {
if (!isset($_SESSION[$name])){
$_SESSION[$name] = array();
$_SESSION [$name][] = $value;