High-Level Infrastructure
In this module, you’ll learn how to create high-level Nullable infrastructure wrappers that make application code easier to write and test. You’ll build Rot13Client
, an infrastructure wrapper for a ROT-13 microservice.
Concepts
Download the slides and transcript here.
Direct links to patterns discussed in this module:
- Infrastructure Wrappers
- Fake It Once You Make It
- Paranoic Telemetry
- Nullables
- Configurable Responses
- Output Tracking
Primers
You may wish to familiarize yourself with these primers before starting on the exercises:
- JavaScript Basics
- Introduced in challenge #1:
- Introduced in challenge #2:
- Introduced in challenge #3:
- Introduced in challenge #5:
- Introduced in challenge #6:
- Introduced in challenge #8:
- Introduced in challenge #10:
- Introduced in challenge #11:
Exercise Setup
Start with the Pre-Course Setup. Then:
1. Check out the code
- Check out the exercise branch:
- JavaScript:
git checkout high-level-infrastructure-js
- TypeScript:
git checkout high-level-infrastructure-ts
- JavaScript:
- Create a custom branch for your changes:
git checkout -b my-high-level-infrastructure
2. Prepare to start working
- Open the exercise files:
src/www/infrastructure/_rot13_client_test.js
(or.ts
)src/www/infrastructure/rot13_client.js
(or.ts
)
- Run the build watcher from the root of the repository:
- Windows:
.\watch.cmd quick
- Mac/Linux:
./watch.sh quick
- Windows:
- Confirm that the build runs and ends with
BUILD OK
.
Exercises
The course is designed to have more exercises than you can finish in a single session, so don’t worry about finishing everything. Instead, work at your own pace and focus on understanding the material. If you get to the end of challenge #5, you’ll have covered the most important information.
- Challenge #1: Fake It Once You Make It
- Challenge #2: Signature Shielding
- Challenge #3: Parsing Responses
- Challenge #4: Request Tracking
- Challenge #5: Nullability
- Challenge #6: Configurable Responses
- Challenge #7: Unexpected Status
- Challenge #8: Simulating Errors
- Challenge #9: Refactoring
- Challenge #10: Edge Cases
- Challenge #11: Design Changes
- Bonus Challenges