title: The plugin design pattern explained (as described by Martin Fowler)
body: <p>I am trying to understand and exercise the <a href="https://martinfowler.com/eaaCatalog/plugin.html" rel="noreferrer">plugin pattern</a>, as explained by Martin Fowler.</p>
  
  <p>I can understand in which way it makes use of the <a href="https://martinfowler.com/eaaCatalog/separatedInterface.html" rel="noreferrer">separated interface</a> pattern, and that it requires a factory to provide the right implementation of the interface, based on the currently used environment (test, prod, dev, etc). But:</p>
  
  <ul>
  <li>How exactly does the factory read the environment values and decide which object (implementing the <code>IdGenerator</code> interface) to create?</li>
  <li>Is the factory a dependency of the domain object (<code>DomainObject</code>)?</li>
  </ul>
  
  <p>Thank you very much.</p>