Following in the pattern of his previous articles about parts of Zend Framework v2, Matt Setter has posted this new article focusing on the ServiceManager component of the framework and what roles it plays.
The Zend Framework 2 Service Manager simplifies web application development in a number of ways, primarily by making configuration a breeze. In this, the 4th post introducing Zend Framework 2, you will learn what the ServiceManager is, how to use it and how it simplifies app development time. [...] In this, the fourth and final installment, we look at the ServiceManager component. This is a highly critical, but potentially misunderstood, aspect of the framework. One that, when understood, makes the rest of the framework a breeze (well, close).
He starts by explaining what the intent of the ServiceManager is and how it implements the Service Locator design pattern. Simply put, it's a repository for the objects/services your application needs to run and allows them to be set and fetched easily. He talks some about how to configure the manager and provides a simple code example showing the addition of objects to a manager instance. These objects (factories) are then called via a "get" method and used directly.
This is the burning question in this post. Does it really make web application development simpler? In short, yes. [...] At first it requires effort, it requires discipline and it requires concentration. It's not easy, sure. But with time, this new skill makes doing what you used to do much simpler, such that you do more in less time, with less effort, with less concentration.