Archive for the ‘OOP’ Category

PHP Inheritance of a class property’s visibility

Friday, September 3rd, 2010

In Object-Oriented PHP5 a class’s properties can have their ‘visibility‘ set.

If a property is undeclared …

PHP Static Methods Can Be Declared Without Static Keyword But Called Statically

Friday, September 3rd, 2010

Whenever I create a PHP class method that I intend to use statically, I declare it as …

Zend Config XML and INI files - How to Specify False and Other Non-String PHP Data Types

Friday, August 27th, 2010

Zend Config INI and Zend Config XML are handy adaptors that allow you …

How to Convert a Legacy Site over to Zend Framework - 1 Favour Refactoring over Rewriting

Tuesday, May 18th, 2010

Over the years, I have often been faced with the choice of whether to refactor or rewrite.

In …

A PHP secret to understanding Data Mapper Pattern in Fowler’s Patterns of Enterprise Application Architecture (PoEAA)

Tuesday, February 9th, 2010

Here’s a snippet of a Java code example in Fowler’s esteemed  book, Patterns of Enterprise Application Architecture …

How to Unit-Test for Expected Exception Thrown in Simpletest - *The* Answer

Saturday, January 16th, 2010

I keep forgetting how to assert that an Exception is going to be thrown in Simpletest version …

Creating a PHP Subclassed Singleton to Apply Fowler’s “Introduce Null Object” Refactoring

Saturday, January 16th, 2010

I found a need to implement the “Introduce Null Object“ refactoring procedure that is …

PHP - Getting __sleep to return all properties of an object

Monday, January 11th, 2010

If you write a custom __sleep() magic method for a PHP class, you are expected …

Checking if an object has been serialized in PHP

Monday, January 11th, 2010

I had a class that relied upon an object’s spl_object_hash() which the PHP documentation states …

Picking Aggregate Roots - Domain Driven Design

Saturday, October 17th, 2009

I’m steadily thinking more and more in terms of Domain Driven Design.

I had often found …