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