Category Archives: Design Patterns

Autoloading Element References with the DOM

It’s been a long time since I sat down and wrote anything about JavaScript; and with Dustin’s new book on design patterns in JavaScript, I felt that this would be a good time to post about a pattern that I’ve … Continue reading

Posted in Code, Design Patterns, JavaScript | Tagged , | Leave a comment

One Step Closer to an Abstract Singleton

The singleton is an incredibly useful pattern in PHP for many reasons. I tend to find myself using them when I know I should be using static classes, but can’t because of PHP’s lack of proper class name discovery in … Continue reading

Posted in Code, Design Patterns, PHP | 3 Comments

FIEO with PHP 5 Interceptors

Note: Before getting into this, it may be easier to just download the file, run the code, then read this post. Thanks to the efforts of Chris Shiflett and other PHP security experts, Filter Input/Escape Output (FIEO) is now a … Continue reading

Posted in Code, Design Patterns, PHP | 8 Comments

The Abstract Collection

I discovered something cool the other day while playing around with a PHP class that was designed to hold a bunch of items of a certain type. Essentially it is a way to get around PHP’s lack of strict type … Continue reading

Posted in Code, Design Patterns, PHP | Leave a comment