Trait-like Functionality for PHP

Trait-like Functionality for PHP

Eliminating repetition and encouraging code reuse are central tenets of software development.
PHP’s lack of multiple inheritance means sometimes there are tough design choices to be made when similar functionality is required in separate branches of the class heirarchy.
As proposed in the Horizontal Reuse for PHP RFC, traits offer a means of duplicating functionality in [...]

Read full storyComments { 5 }
Super-Skinny your Zend Framework Action Controllers (Part One)

Super-Skinny your Zend Framework Action Controllers (Part One)

Inspired by Padraic Brady’s post on Fat Stupid Ugly Controllers and Chris Hartjes’ Fat Models, Skinny Controllers, I’ve been putting my controllers on a crash diet.
Slim controllers are easier to test, encourage the DRY principle and force business logic back into the model layer where it belongs.
In this first article, I’ll be looking at a [...]

Read full storyComments { 6 }
Practical Nested Transactions with Zend_Db and MySQL

Practical Nested Transactions with Zend_Db and MySQL

The need to save dependent or child models appears frequently in object oriented applications. In such cases, it’s usually desirable to group all the save operations for a parent and its children into a single atomic transaction. Many RDBMS brands support transactions, but few can handle these kind of “nested” transactions.
This article discusses how to [...]

Read full storyComments { 11 }
Blimey! I’ve got a blog!

Blimey! I’ve got a blog!

To be honest, I’m a bit ashamed.
I’ve been working with web development and internet marketing for almost half a decade and only now, in 2010 for Christ’s sake, have I got round to starting a blog.
There are plenty of excuses: haven’t had the time, I thought it might be tricky to set up, didn’t need another [...]

Read full storyComments { 5 }