Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC305 Summer Lecture 08

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

CSC305 Summer Lecture 08

Individual Software Design and Development
Code Review
(202508)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

August 11, 2025
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development | Summer Version Lecture 08. Code Review
  2. Original Project Reuse (Complete as needed) your Code from Assignment

    1 Add a GUI + Listeners Class Diagram (Use Astah Tool)
  3. Github + Maven • Follow M a ven directory structure

    • Commit only f iles th a t a re expected to be in the repository 5
  4. Driver • Entry point of the a pplic a tion.

    • Cont a ins the m a in(String[] a rgs) method. • Expects the folder p a th a s a comm a nd-line a rgument. • C a lling object: f ileH a ndler.re a dFileN a mes(folderP a th) to get f ile n a mes. • C a lling object: bo a rdM a n a ger.cre a teBo a rd( f ileN a mes) to gener a te the bo a rd l a yout. 6
  5. FileHandler • Re a ds f iles from the given

    folder. • Cont a ins a method re a dFileN a mes(String folderP a th) th a t: (1) Re a ds a ll non-directory f ile n a mes in the speci f ied folder; (2) Returns a n a rr a y of strings with the n a mes. 7
  6. BoardHandler • M a n a ges the bo a

    rd a nd its l a yout. • H a s a n Arr a yList<Squ a re> to store squ a res. • The cre a teBo a rd(String[] f ileN a mes) method: (1) Cre a tes one Squ a re per f ile n a me; (2) C a lcul a tes the optim a l number of columns a nd rows to f it a ll squ a res in a l a yout close to a squ a re (e.g., 5×4 for 18 f iles, not 6×3). 8
  7. Square • Represents one visu a l unit on the

    bo a rd. • Stores: (1) The f ile n a me; (2) Position on the bo a rd (column a nd row); (3) A color, a ssign a color to e a ch f ile a ccording with some condition such a s size, d a te of cre a tion, or just r a ndom (for now). • H a s a method toString a s follows: @Override public String toString() { return String.format("(%d,%d) %s [%s]", row, col, fileName, color); } 9
  8. Lab

  9. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Summer 2025 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.