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>>
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>>
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>>
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.
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>>