Project 2: Overview
In this two-part project, you’ll extend your Analyzer from Unit 1 and spin up your first Java web app with Servlets. You’ll plan, build, submit, and present—just like a real dev team shipping a new feature and a simple site.
You’ll complete Project 2 in four stages:
- Plan → Update the class diagram and write pseudocode/tests for
DistinctTokenCountsAnalyzer.processToken()
- Build → Add analyzers, properties loading, and a run script update; then create a small web app with a homepage and servlets.
- Submit & Reflect → Capture required screenshots, push to GitHub, and write your reflection.
- Code Review → Walk through your code, answer focused questions, and note feedback.
Part 1 – Plan
- Update your class diagram to reflect new classes, fields, and methods.
- Write pseudocode for processToken() in DistinctTokenCountsAnalyzer.
- Create at least two pseudocode tests that “dry-run” your logic.
Deliverables: Class diagram screenshot, plan-pseudocode file, GitHub issue “Project 2 plan ready for review.”
Heads-up (must read): You need a MET on the plan before coding. If it’s clear code was written first, the plan may be marked Not Yet.
Part 2 - Build
Analyzer -- continued!
- Run script: Update
runAnalyzer.sh
to load your properties file. - Interfaces: Adjust
TokenAnalyzer.generateOutputFile(String)
signature; usePropertiesLoader
(default method) to load config. - Properties: Create
config/analyzer.properties
(e.g., output.directory, application.name, author, etc.). - Analyzers: Implement updates including
LargestTokensAnalyzer
andDistinctTokenCountsAnalyzer
enhancements.
Your first web application
- Start using Tomcat
- Pages/Servlets: Create a simple homepage, a first servlet, and a properties servlet that reads from your project properties.
Deliverables: Fully functional Analyzer and Web program, passes all tests, correct output files, complete JavaDoc.
Part 3 - Submit & Reflect
Go to Project 2 Submission & Reflection
- Screenshots: Save required images under
screenshots/project-2
- Push to GitHub: Stage → commit → push.
- Open an issue: “Project 2 ready for review” and complete the reflection prompts.
- Optional: If doing the live review later, you can schedule or record now.
Deliverables: Screenshots, GitHub repo updated, reflection completed.
Part 4 – Code Review
- Walkthrough (~10 min):
- Show Analyzer changes and logic flow.
- Show servlet flow/logic.
- Be ready to answer: debugging example, best practice, programming principle, OOP concept, and collections usage.
Deliverables: Code review completed, notes saved, corrections made if needed.
You need to complete 2 code reviews to pass the course. If you are in an in-person class, code-reviews can be completed during class time.
Pro Tips
- Plan first, code smarter. Your plan should drive your code—not the other way around.
- Properties everywhere. Remove hard-coded strings; centralize config in
analyzer.properties
. - Test. Always validate on
bigFile.txt
before you call it done. - Commit like a pro. Frequent, meaningful commits make your reflection, and troubleshooting, much easier.
- Use correct Java terms in your review; avoid vague “this over here” phrasing.
By the end of Project 2, you’ll have:
- A more robust Analyzer that’s configurable and scalable.
- A working Java web app with a homepage and servlets.
- A polished submission with screenshots and a thoughtful reflection.
- Confidence explaining your code and decisions in a code review.