Materials for week 7 lab in CS-370, which includes Ch. 8 "Functions & Closures" adapted from Software Design by Example by Greg Wilson.
February 27, 2024
Organization:
- SDX-ch9: The code files for the SDX Ch. 8 activity (as downloaded directly from the book website, unmodified)
Enter your names here Aidan and Uli
Who will start out as
- DRIVER: Driver's name Aidan
- NAVIGATOR: Navigator's name Uli
You will switch halfway through the SDX Ch. 9 activity.
Write your answers to the questions below.
- What were the main ideas from SDX chapter 8?
- Using mock objects to make testing easier, using protocols to change objects back to their normal function after testing, using decorators to wrap a function with another funciton, and using the iterator design pattern to iterate through something.
- What questions did you have about the material in the chapters? What did you find confusing? Protocols and decorators were a bit cloudy. Fill in the following table with your definitions and examples for the main concepts of this chapter --- mock objects, context managers, decorators, iterators.
| Concept | Brief Definition | When to use (generally) | Potential uses in audio archive project | | mock objects | simulate real objects for testing | test components without dependencies | simulate interactions with external audio processing libraries during testing | | context managers | manage resources with 'with' statement | ensure proper resource handling | manage file handlees for reading and writing audio files | | decorators | modify functions without changing the structure | add cross-cutting concerns to functions | add logging to audio processing functions | | iterators | traverse sequences efficiently | process large or infinite sequences | iterate over sequences of audio files |
| git status | List all new or modified files | List all new or modified files | List all new or modified files |
Write a short summary of what you did (which exercises) below.