Back to Home

Homework 2 Reflection

Design

  1. What changes did you need to make and why? Would you structure your back-end differently in the future?
  2. I did not change a lot of back-end as I was implementing my frontend. The only change I did was changing the query for the GET requests: /api/books/search and /api/book so that it got the authors' name and also sort by the book title in ascending order.

  3. Did you also perform client-side validation or did you rely on server-side validation alone? What are the pros/cons of making either choice?
  4. The current code relies on server side validation, as the backend processes the data, checks for errors, and returns the appropriate messages. Having server side validation ensures security, centralized validation logic, and data context awareness. The cons of this is that it's slower feedback, increased server load, and potentially poor UX.

React

  1. What was your experience manipulating state with React components (especially with the useEffect hook)? What kinds of things did you struggle with?
  2. In my frontend code, I only used the UseEffect hook. One of the things that I struggled a little with was the trigger for the hook. Figuring how and when it went off took some time. The UseEffect hook was also used in our activity and so I was referencing that code a little bit for understanding.

  3. What was your experience using types with the front-end? Did they catch any bugs? Did you have to make a lot of manual annotations? Did you resort to using any frequently, and if so, why?
  4. I did not resort to using any. Using types in the frontend felt interesting. Looking through the code, I realized there weren't a lot of places where I used types. The setup felt time-consuming and I definitely think there's a learning curve to fully leverage TypeScript (which I know I'm not doing).

Compare and Contrast

  1. Compare and contrast your experiences writing an SPA front-end with React to writing a MPA front-end like we did in CS375. Which was harder? Which did you enjoy more? How did you feel about the experience generally?
  2. I think I enjoyed writing an SPA front-end with React compared to writing a MPA front-end. Maybe it's because we're using React and everything is just a little simpler because of it. SPA front-end with React does have its challenging concepts like state management and virtual DOM but there is more customizability. Writing an MPA in CS375 felt very limited (when I was learning it since my group used React for the class project). It was definitely simpler in terms of its traditional model with it following the request-response cycle with server-side templates generating HTML. Overall, I do enjoy something like this.

    //edit: after reading 4b, it seems like MPAs are, on average, better. I actually don't know which I like...