Skip to content

Project 3: Overview

In this project, you’ll continue developing your Analyzer application by expanding its functionality and code design. You’ll design and implement new analyzers, deepen your object-oriented programming skills, and refine your ability to explain and reflect on your work.

Project 3 has four stages:

  1. Plan β†’ Understand requirements, update your design, and prepare pseudocode.
  2. Build β†’ Add TokenLengthsAnalyzer and TokenLocationSearchAnalyzer; then create two web apps (HTTP Request + Properties) using MVC.
  3. Submit & Reflect β†’ Finalize your code, capture evidence (screenshots), push to GitHub, and complete your reflection.
  4. Code Review β†’ Walk through your updated code with your instructor, explaining your design and decisions.

Part 1 – Plan

Go to Project 3 Plan

  1. Update your class diagram to include:

    • TokenLengthsAnalyzer
    • TokenLocationSearchAnalyzer.
  2. Write pseudocode processToken() method in the TokenLengthsAnalyzer.

  3. Write pseudocode processToken() method in the TokenLocationSearchAnalyzer.
  4. Create pseudocode β€œtests” to trace how tokens are processed and counted in the processToken() method in the TokenLengthsAnalyzer.
  5. Create pseudocode β€œtests” to trace how tokens are processed and counted in the processToken() method in the TokenLocationSearchAnalyzer.

πŸ“¦ Deliverables: Updated class diagram screenshot, plan-pseudocode file with tests, GitHub issue β€œProject 3 plan ready for review.”

Heads-up: 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

Go to Project 3 Requirements

Analyzer -- continued!

TokenLengthsAnalyzer

  • Determine the token lengths and count.
  • Write to output/token_lengths.txt in two columns

TokenLocationSearchAnalyzer

  • Load search terms from config/search-tokens.txt
  • Determine if search token is in the input file and record it's location.
  • Write to output/token_locations.txt with a 80 character limit.

Add Properties:

  • Update analyzer.properties with the new output paths
  • output.file.token.lengths

πŸ“¦ Deliverables: New analyzers implemented, program runs successfully, tests pass.

Your Java112 web application

HTTP Request App

  • JavaBean (HttpRequestData): store request info (method, URI, URL, protocol, server name/port, locale, query string, queryParameter, and User-Agent).
  • Servlet (HttpRequestServlet): populate bean from request, attach to request attributes, forward to JSP.
  • JSP (httpRequestData.jsp): match site design, list all bean values using EL.

Properties App

  • JavaBean File (project3.properties): add entries for author name/email, course title & format, instructor, project description.
  • Servlet (PropertiesServlet): load properties in init(), attach to request, forward to JSP.
  • JSP (project3Properties.jsp): match site design, display properties in a 2-column table (property name β†’ value).

πŸ“¦ Deliverables: Updated index.jsp with links to both servlets, HttpRequestServlet and PropertiesServlet. Screenshots of pages and corrects outputs.


Part 3 - Submit & Reflect

Go to Project 2 Submission & Reflection

  • Screenshots: Save required images under screenshots/project-3
  • Push to GitHub: Stage β†’ commit β†’ push.
  • Open an issue: β€œProject 3 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 (two new analyzers).
    • Show web applications (MVC flow from servlet β†’ bean β†’ JSP).
  • 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 pseudocode and diagrams save debugging later.
  • Efficiency matters. The bigFile.txt must run in under 15 seconds.
  • Use properties. No hard-coded filenames, pull from .properties files.
  • Use the MVC. Keep logic in beans/servlets, not in JSPs.
  • Test everything. Validate outputs on small + big files and web pages.
  • Commit often. Frequent commits!!

By the end of Project 3, you’ll have:

  • A high-performance Analyzer with two new analyzers.
  • A working Java web app with MVC (Servlets, JSPs, JavaBeans).
  • A polished submission with screenshots and reflection.
  • Confidence presenting your code, both CLI and web, in a code review.