Summary
In this chapter, we created an application which plots the result of an arbitrary mathematical expression on a graphics surface. We used WPF for our rendering purpose. We also created an expression evaluator library, which uses the recursive descent parsing technique to parse an expression to a data structure called AST. The AST can be walked depth-first to evaluate the value. This is a good example of the interpreter pattern. We used the observer pattern to automatically relay the changes in the expression input to the canvas object. In the next chapter, you will learn how the .NET framework library leverages patterns to expose a good API for developers.