Home

CS 478 HW 3 Reflection

Node

How easy was it to reuse your add book request handler logic for your edit handler? What changes did you need to make and why?

Honestly, I probably could've reused more functionality by writing reusable functions for common things like validating that a book already has a valid author_id, or that the book even exists, though I'm currently getting over a cold and I don't really have much energy so I just went with the lazy route of copy-and-paste. If there's furthur work on this codebase in a future assignment I'll do some refactoring to fix this.

What was your experience writing tests for your edit and delete endpoints?

It wasn't too bad. I actually wrote the delete endpoint in a prior HW assignment by mistake, so I only needed to write test cases for the PUT route, but even in that case it was fairly similar to POST, so I was able to largely copy tests with minor tweaks to account for updating a book rather than creating a new one entirely

React

How did you integrate the book editing and deletion into your UI? Why did you choose the design you did?

For the Delete I just added a button in the table because delete's a pretty basic operation and doesn't really need much more than that. For edit, I initially tried implementing a sort of system where you when click edit on a book in the table, the text cells in the row turn into inputs and you can edit the book right there in the table. Though once I started doing this, I quickly realized the state management's a message, and I don't have the bandwidth right now to figure it out, so I reverted those changes and opted for a simple edit page that take in a route param `:id`. I was able to componentize the Book Form from the create book page, and then reuse it in the update book page which made my life a lot easier. I wasn't able to easily seperate the error state because it's set inside the submit handler, so I kept that in the parent component in both cases, but in a future HW assignment I might compoentize that as well

What parts, if any, did you struggle with when implementing edit/delete in the UI?

My initial attempt to have inline editing for the books was a total disaster. I was trying to keep track of which book is being edited, what controls can and cannot be accessed while editing is in progress, and other confusing logic to keep track of. I have a feeling I probably overcomplicated it, because I've implemented inline editing before in other projects and had little issue implementing it. Tbh I was rushing a little for this assignment, and I think if I took my time more I probably could've done inline editing.

Material UI

How did you feel about Material UI's API and its look and feel?

It's alright. It was easy enough to implement, and the visuals are very responsive, though I personally like the flat fogged glass asthetic used in the apple design system more.

How easy was it to refactor your existing UI to use Material UI?

I wasn't hard at all. Most of the components I used only need a tag name changes and a `variant` attribute added, and other than that everything continued to work out of the box.