title: What is the "Dispatcher" design pattern?
body: <p>What is the "dispatcher" pattern and how would I implement it in code? </p>
  
  <p>I have a property bag of generic objects and would like to have the retrieval delegated to a generic method. </p>
  
  <p>Currently, I have properties looking for a specific key in the bag. For example:</p>
  
  <pre><code>private Dictionary&lt;String, Object&gt; Foo { get; set; }
  private const String WidgetKey = "WIDGETKEY";
  
  public Widget? WidgetItem
  {
      get
      {
          return Foo.ContainsKey(WidgetKey) ? Foo[WidgetKey] as Widget: null;
      }
      set
      {
          if (Foo.ContainsKey(WidgetKey))
              Foo[WidgetKey] = value;
          else
              Foo.Add(WidgetKey, value);
      }
  }
  </code></pre>
  
  <p>It was suggested that this could be more generic with the "dispatcher" pattern, but I've been unable to find a good description or example.</p>
  
  <p>I'm looking for a more generic way to handle the property bag store/retrieve. </p>