title: Is there a name for the design pattern used by drupal_alter()?
body: <p>Within Drupal, the drupal_alter() function is used with the following pattern:</p>
  
  <ol>
  <li>Your module (foo) produces some type of object, say by providing a foo_get() method.</li>
  <li>Before returning the object the foo module calls drupal_alter() on it.</li>
  <li>drupal_alter() calls hooks provided by other modules that alter the object (e.g. bar_foo_alter()) .</li>
  <li>The altered object is returned.</li>
  </ol>
  
  <p>In Drupal it's used for things like allowing modules to extend html forms created by other modules.  More info on how it works in Drupal here: <a href="http://erikwebb.net/blog/drupal-design-patterns/hooks" rel="nofollow">http://erikwebb.net/blog/drupal-design-patterns/hooks</a> .</p>
  
  <p>Is there a name for this design pattern?  To summarize, the necessary criteria are:</p>
  
  <ul>
  <li>A module provides a method that produces an object.</li>
  <li>An arbitrary number of other modules may alter the object before it is returned.</li>
  <li>The altering modules only depend on the producing module.</li>
  <li>The producing module does not depend on the altering modules.</li>
  </ul>