Chapter 8. Designing behavior-centric programs
This chapter covers
- Representing behaviors as functions
- Extending program behavior
- Working with functions and closures
- Testing clients using decision trees
In chapter 7, we discussed data-centric applications, and you learned that the first step to designing functional programs is to define the relevant data structures. There are also cases where the data structure contains some form of behavior. One case might be a command that the user can invoke or tasks that the program executes at some point. Instead of hard-coding every behavioral feature, we want to work with them uniformly, so we need to keep them in a data structure that can be easily modified, either before the compilation or at runtime. ...