Wednesday, 21 December 2011

Design Patterns for PHP

The first thing that attracted me to my current job was not only the cool dev environment and posh screens, but when during the interview one of the guys mentioned that they were working on products designed the right way from the very first line of code. They had time (and money) to think the best aproach for a whole series of interesting stuff being built. In PHP terms that directly implies in the use of a lot of cool design patterns that previously before I have just seen on books!

Before checking the coolest patterns I have been involved recently it might worth to review some basic concepts in PHP which will make it simpler to understand some more "advanced" technniques:

Ok, bellow are the main patterns I have to scratch my head around on a daily basis:
 

Fluent Interface
Martin Fowler coined the term “FluentInterface” to describe objects that expose an interface that flows, and is designed to be readable and concise.  The cost of this fluency is additional effort required to design the interface for your object and the slight increase in complexity.  These types of interfaces are often utilized to create configurations for your objects but can progress into an internal Domain Specific Language or DSL.

No comments:

Post a Comment