concept experiment in category php

appears as: n experiment, experiment
PHP in Action: Objects, Design, Agility

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.

In the following subsections, we’ll explore the SRP in practice. We will see how a kind of class that is common in PHP—the template engine—typically mixes several responsibilities. Then, as an experiment, we’ll tease the responsibilities apart, creating one class for each of them. Finally, we’ll sum up, checking out how successful the experiment was.

6.3.3. Was the experiment successful?

The reason we did the experiment—dividing up the Template class to separate the responsibilities—was to see where it went, to learn something, and from that perspective it was a success. But apart from that, is the version with three classes better than the single class? On the face of it, no: the Template class has hardly changed at all; all we’ve done is wrap basic PHP functionality in two classes.