Why I Hate Singletons

One of the most derided, yet most loved and used patterns is the singleton pattern. Its supporters continually praise its ability to limit instantiation of objects and its opponents continually chastise its tendency to be little more than a glorified global.

While programming in many ways boils down to a matter of preference (you can always find someone that agrees with you,) I thought I might as well document my opinion so that those who don’t care can have one more thing to ignore.

Details after the jump

Continue reading Why I Hate Singletons

Book Review: PHP5 CMS Framework Development by Martin Brampton

PHP5 CMS Framework Development (published by packt publishing) is a a book that offers "Expert insight and practical guidance to creating an efficient, flexible, and robust framework for a PHP5 based content management system." Upon reading through the book I have found that it gives an excellent case study of Martin Brampton’s approach to CMS design and implementation. Brampton has been very active in the PHP CMS scene for several years working on widely known projects such as Mambo and Joomla. He is also the creator of Aliro, a newer CMS that had the purpose of utilizing more of the object oriented abilities of PHP5. His experience designing and developing Aliro influenced much of this book.

One might be concerned that the ideas in this book are slanted towards how Brampton decided to implement various aspects of Aliro. While it is true that much of the book uses code directly out of Aliro, I feel that he did take the time to make sure he explained the reasons for the design and development decisions he made. This is the feeling that brings me to the overall conclusion that this book is ultimately an in depth case study of the design of Aliro. If you are interested in developing your own CMS framework or have already developed a framework that you would like to extend, then I would highly recommend this book. Even if you do not agree with all of the concepts and ideas presented it does a fantastic job at pointing out potential pitfalls and other items to consider as you work on your CMS.

After the jump I give a chapter by chapter breakdown of the book.

Continue reading Book Review: PHP5 CMS Framework Development by Martin Brampton