Chapter 13 program design
By now we have covered almost all the mechanics of writing Java programs from primitive types and basic control constructs to using classes—our own, classes built into Java such as
ArrayList, Scanner, and Files, and classes written by other programmers like Turtle and World. And we have looked at some of the important kinds of algorithms that come up in many programs: searching, sorting, and recursion.
In some sense that’s all we need to know to write Java programs. Now it’s just a matter of putting the pieces together. However, as you’ve probably already discovered even small programs can start to get complicated and it can be hard to keep track of all the pieces and how they fit together.
In this unit, we will look at how to think at a higher level about designing our programs. For any given program that we might want to write there are many, many ways to break it down into classes. While the Java compiler doesn’t care how your program is organized, as long as it follows the rules of Java, programmers have learned that it matters a lot us humans.
In this chapter we will look at some of the ways to think about our classes and how they fit together that we can use before we jump into coding. In particular we will look some key kinds of abstraction and how they help us keep our programs manageable.
In the last section we’ll look at some of the larger implications of designing programs: how software affects society and some issues we need to think about when designing software to avoid harms it might cause.

