title: What mathematical duals are there in OO programming?
body: <p>If you have watched <a href="http://channel9.msdn.com/shows/Going+Deep/" rel="nofollow noreferrer">Going Deep shows of the Channel9</a> lately, one very frequently mentioned topic is <a href="http://en.wikipedia.org/wiki/Dual_(category_theory)" rel="nofollow noreferrer">mathematical duality</a> in programming. TomasP has a good <a href="http://tomasp.net/blog/event-object-duality.aspx" rel="nofollow noreferrer">blog post</a> about duality in object oriented programming.</p>
  
  <p>This has been since Microsoft Research found that the observer design pattern is actually a mathematical dual of the iterator pattern. Since then they have used the duality concept in <a href="http://channel9.msdn.com/shows/Going+Deep/Bart-De-Smet-Observations-on-IQbservable-The-Dual-of-IQueryable/" rel="nofollow noreferrer">various ways</a>.</p>
  
  <p>My question is:</p>
  
  <p><strong>What mathematical dualities are there in programming?</strong></p>
  
  <p>Object oriented programming is a good start. The major GoF design patterns are: Decorator, State, Iterator, Facade, Strategy, Proxy, Factory Method, Adapter, Observer, Template Method, Composite, Singleton, Abstract Factory and Command. <a href="http://www.mcdonaldland.info/files/designpatterns/designpatternscard.pdf" rel="nofollow noreferrer">Here</a> is a good object-graph-poster.</p>