Home arrow PHP arrow Registry Design Pattern: Complete Implementation

Registry Design Pattern: Complete Implementation

Welcome to the conclusion of a three-part article series that shows you how to implement the Registry design pattern in PHP. In this part, we'll take all the classes that we've created so far and put them to work together.

TABLE OF CONTENTS:
  1. Registry Design Pattern: Complete Implementation
  2. Review: building a basic session-based registry
  3. Defining a basic autoloader class
  4. Using the registry classes in a single script
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
July 21, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

So, if you're a PHP developer who wants to expand your current programming skills by learning how to implement the Registry design pattern in a few simple steps without having to deal with obscure and hard-to-grasp concepts, then you've come to the right place.

And now that you know what to expect from these articles, it's time to review the topics covered in the last one. In that article, I demonstrated how to create a basic, yet functional registry class. The class could save and retrieve resources across different points of an application by using the $_SESSION superglobal PHP array.

Hidden behind a fancy name, this sample class was nothing but a basic session handler that took advantage of the functionality offered by the registry pattern to do its business. This showed that registries can be used in distinct situations and with multiple persistent layers, but in all cases with similar purposes.

So far, I've illustrated how to build a few registry classes that used different storage mechanisms for storing/retrieving resources throughout several stages of a PHP program. That's all well and good, but it'd be useful to show how to put all of these classes to work in conjunction, at least for educational reasons.

That's exactly what I plan to do in this last chapter of the series, thus finishing this humble introduction to applying the registry pattern in PHP. So, don't hesitate any longer; start reading right now!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap

Dev Shed Tutorial Topics: