title: Difference between Service and Manager classes in Zend Framework 2
body: <p>I'm getting a little confused about the <code>Manager</code> and <code>Service</code> class name suffix. </p>
  
  <p>As far as I understand the difference, <code>Managers</code> are responsible for handling (creating, retrieving, deleting, ...) certain types of entities. For instance, the <code>ModuleManager</code> is responsible for loading and returning <code>Modules</code>. In this case, you <em>do</em> care about the actual entity, the <code>Module</code>.</p>
  
  <p>However, <code>Services</code> are classes that provide interfaces to execute cetain types of process logic. For example, a <code>LogService</code> sends a given log message to the defined log writer. You don't care where it goes and what it does, you just want the admin to be informed about what just happened.</p>
  
  <p>Now, ZF2 provides a <code>ServiceManager</code> that creates and returns instances of a given <code>Service</code>. I accidentally got used to creating <code>Managers</code> and providing a <code>factory</code> to the <code>ServiceManager</code> so that you can access the <code>Manager</code> using <code>$this-&gt;getServiceLocator()-&gt;get('managerName');</code> in the <code>Controller</code> context in order to keep controllers tiny and the real logic in testable classes. This is the part that is confusing me right now because obviously, it can't be recommended to retrieve <code>Managers</code> using a <code>ServiceLocator</code>. <strong>BUT</strong>: I'm not the only one doing this: The <code>Doctrine ORM</code> module is another example for this: It registers the <code>EntityManager</code> as a <code>doctrine.entitymanager.orm_default</code> <strong><code>Service</code></strong> by default.</p>
  
  <p>Am I getting the true difference between <code>Services</code> and <code>Managers</code> wrong? Is there even a difference? Are <code>Managers</code> maybe even inherited from <code>Services</code> in the concept?</p>