25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8<br />

Elements of Object-oriented Design<br />

The benchmark of a good programmer, regardless of what language they work with,<br />

is their ability to apply well-known and accepted design techniques to any given situation.<br />

Design Patterns are generally recognized as an excellent set of tried-and-true<br />

solutions to common problems that developers face every day.<br />

In this chapter, we’ll focus on how some of <strong>PHP</strong> 5’s new facilities, such as proper<br />

object orientation, can make the development of pattern-driven applications easier.<br />

While the exam is not strewn with complex examples of pattern development, it does<br />

require you to have a firm grasp of the basics behind design patterns and their use in<br />

everyday applications.<br />

Design Pattern Theory<br />

As we mentioned in the previous section, design patterns are nothing more than<br />

streamlined solutions to common problems. In fact, design patterns are not really<br />

about code at all—they simply provide guidelines that you, the developer, can translate<br />

into code for pretty much every possible language. In this chapter, we will provide<br />

a basic description of some of the simpler design patterns, but, as the exam<br />

concerns itself primarily with the theory behind them, we will, for the most part,<br />

stick to explaining how they work in principle.<br />

Even though they can be implemented using nothing more than procedural code,<br />

design patterns are best illustrated using OOP. That’s why it’s only with <strong>PHP</strong> 5 that<br />

Licensed to 482634 - Amber Barrow (itsadmin@deakin.edu.au)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!