And now that you know what to expect from this series of articles, it’s time to quickly review the topics that were covered in the last tutorial. In that part of the series I built a simple application in PHP 5 composed of two classes for its building blocks. The first was merely a basic MySQL abstraction class, while the second was a storage class that took advantage of the functionality given by the first to persist across different HTTP requests. Of course, the interaction established between these two classes was achieved via a factory method that allowed sharing of the same database handler between multiple persistent objects. The process demonstrated how useful this type of method can be in such a situation. However, I’d like to finish this series on building factory methods by explaining how the database-driven application developed in the preceding article can be optimized even more with a few little tweaks. In this case, thanks to a simple implementation of the Dependency Injection pattern, it’ll be possible to completely avoid the utilization of the factory method. Do you want to learn how this will be done? Then start reading now!
blog comments powered by Disqus |