-
Book Overview & Buying
-
Table Of Contents
Design Patterns and Best Practices in Rust
By :
In this chapter, we'll explore the first set of behavioral design patterns in Rust and how they can enhance our calculator with better interaction models and operation handling. Behavioral patterns focus on algorithms and the assignment of responsibilities between objects. They describe patterns of objects and types, and the patterns of communication between them.
We'll continue developing our Correct Calculator project, building on the structural foundation established in the previous chapter. While the structural patterns helped us organize our calculator's components, behavioral patterns will help us define how these components interact and communicate. We'll see how patterns such as Command and Strategy can transform our static calculator into a dynamic, interactive application with advanced features such as undo/redo functionality.
First, we'll examine the Command pattern, which allows us to encapsulate...