Turbo Pascal included the source code of a working spreadsheet written in Pascal. Reading it was a revelation for me: I quickly understood how to structure code in small procedures and functions.<p>I see that my students have trouble structuring their code in classes and methods, and I think that going through an exemplar project in classroom would help them a lot. Which projects would you recommend?<p>Ideally, I'd want something:
non-trivial in size (tens of classes) and structure (use of composition, inheritance, dynamic dispatch, containers, enumerations, maybe interfaces, threads, generics, streams);
useful in everyday situations that the students can readily appreciate;
easy to build;
written with impeccable style in terms of structure, naming, commenting, and formatting;
accompanied with unit tests;
not dauntingly complex (this made me rule out the JDK libraries);
of manageable size (< 100k LoC, ideally < 10k LoC).