Submitted by andy.pangus on Mon, 06/08/2009 - 16:15
Documentation is an important part of any project. When creating software, code alone is insufficient. There must be some text along with it to describe various aspects of its intended operation. It is important for the code documents to be thorough, but not so verbose that it becomes difficult to maintain them. Enter NaturalDocs. Natural Docs is an open-source documentation generator for multiple programming languages.
The Command Pattern is a design pattern implemented for a multitude of purposes: progress bars, wizards, thread pools, multi-level undo, and networking to name a few. By encapsulating the request as an object, the Command Pattern allows us to parameterize other objects with different requests, queue or log those requests, and even support undo functionality.
Sometimes you may find yourself in need of an object that can exist once and only once, for example: registry settings, device drivers, or game objects. To do this we use a pattern aptly named the Singleton Pattern. The Singleton utilizes a private constructor and so can only be instantiated through a call to another method. Here is a basic Singleton.class.php:
Ever need to add new or additional functionality to a class dynamically? Need to make a class that is open for extension but closed for modification? Then the Decorator pattern is for you. How? Simple, we will add a new class to wrap, or decorate, the original class.
Submitted by andy.pangus on Thu, 04/16/2009 - 00:12
One of the biggest complaints I hear about PHP is how ugly it is as a language: function names are not case-sensitive but variables are, there is a haphazard implementation of many features, and having no real structure enforced on PHP developers makes it easy to write messy code. And the critics may be right. I think Rasmus Lerdorf summarizes PHP best when he says: