laughinghan/mathquill — pull request #97 by laughinghan (2012-07-10 02:54:07+00:00)
Title: Up/Down architecture

First attempt at a generalized architecture for consolidating code dealing with the Up and Down buttons.

Read the commits in order they were added, please.

Alright, so I admit, you were right, this was harder than I speculated. As it is I'm surprised at how well it turned out.

The architecture could almost certainly be more elegant, with only two use cases it will almost certainly not generalize perfectly, but there's virtually no boilerplate or duplicate code, what code there is is fairly cohesive, the contracts of methods aren't too difficult to describe, and yet the behavior is (as far I can tell) completely correct, so by my heuristics it's a surprisingly decent design for such a hard problem.