Draft - Reliable File Persistence
Authoring skeleton - not a student assignment
Three short topics
- Text and binary import/export layers.
- Fixed-size records and RandomAccessFile offsets.
- Exception handling, resource closure, and recovery.
PBL context
Observe AssignmentQueueConverter’s JSON round trip and error handling. Build a separate local record-storage lab; JSON/database storage does not itself demonstrate binary or random-access file competence.
Implementation layers to author
- Adapt the existing text-file lesson to an export/import task.
- Define a binary record format and demonstrate a round trip.
- Update one fixed-size record by offset without rewriting the whole file.
Evidence checklist to author
Test empty files, malformed text, truncated binary records, invalid record indices, and preserved neighboring records. Specify an appropriate execution environment if the browser runner cannot persist files across runs.
Publication checklist
Complete exercises and checks before assigning courses.csa.week, removing draft/hide flags, or enabling submissions.
Code Runner Challenge
Authoring draft - file persistence exercise is not ready
View IPYNB Source
// CODE_RUNNER: Authoring draft - file persistence exercise is not ready
public class PersistenceDraft {
public static void main(String[] args) {
throw new UnsupportedOperationException("Draft: author the file format, exercise, and tests before publication.");
}
}
PersistenceDraft.main(null);
Lines: 1
Characters: 0
Output
Click "Run" in code control panel to see output ...