In "Emergent Design," Scott L Bane describes this as a template for the first step in abstracting the creation of objects.
Day 1: no abstraction ...
$person = new Person($id);
Day 2: a static method to create an object for you ...
$person = Person::getPerson($id);
Why? Because now you have only one piece of code in the entire application that knows how to βupdateβ a person, and not have many lines of code distributed among your entire application with this knowledge. If you change the way you create the user object in the future, you can simply change the static getPerson method.
Day 3+: You can decide to rely on the object builder or repository to create the object. When you decide to do this, you can update the static getPerson method to use the builder / repository, and once again the change occurs in only one place.
This is called cohesion. The presence of code in which you can make changes without opening a lot of files.
source share