Integrating WordPress in a webservice architecture

With the introduction of the WP REST API, I think WordPress is taking a step in the right direction to becoming more adaptable to a wider variety of needs. With a few easy techniques, we can easily build much more complex applications, which use WordPress for what it’s best for. The problem with the default continue>>


Constructor vs Setter dependency injection

I have recently been involved in a debate about the quality differences between constructor and  setter dependency injection. In my opinion constructor dependency injection has multiple advantages over setter injection. Here are some reasons why. Reasons why constructor injection is to be preferred Objects must enforce their state We must try as much as possible continue>>


TDD “Aha !” moments

Robert C. Martin describes 3 very basic rules of TDD. These rules sound very simple. But as simple as they sound, as hard it is for a programmer to get into the Red-Green-Refactor TDD flow. I had many unsuccessful attempts, and, many times, TDD seemed stupid and time-consuming. But, as I kept trying, I had some revelations, continue>>


Reclaim your repositories from Doctrine

Decoupling the persistence layer A lot of web applications are very data centric. They evolve as thin layers around a database. This leads to a very tight coupling between your application and the database, creating a lot of untestable or very hard to test code. This also makes the database present in every part of continue>>


Decoupling your application from the framework

There are a lot of articles written on how to decouple a framework. There are methods to separate the presentation and persistence layer. But these are not the only things a framework can offer. For example, Symfony 2 provides a very nice process component, used for executing commands via the command line.


Reducing code complexity through good design

What is code complexity ? Code complexity or cyclomatic complexity is the number of execution paths a program can take. Basically that is the number of if statements in a program or a method. There are many studies that show there is a direct correlation between the complexity of a program and the number of defects. continue>>