Chris Jarocha cj658 Reflection for HW3


1. Node
a. 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?
It was pretty easy for me to resuse most of my logic from adding a book to updating it as you are passing in the same fields but with update instead of insert. Because these 2 write operations are very similar it made it easy to reusue the code and tests on the backend. Similarly because it requries the same user inputs, I was also able to reuse most of the code for the form on the frontend.
b. What was your experience writing tests for your edit and delete endpoints?
From homework 1 I already had tests written for the delete endpoint so I didn't have to really do that for the delete endpoint. I also realized that since edit is similar to add, I could reuse a good chunkc of my test code to test for diffrent failure edit scenario. The place where writing tests is different in during successful operations, as with add you have tocheck that a new book was added vs in edit yu have to make sure that the correct book was edited.
2. React
a. How did you integrate the book editing and deletion into your UI? Why did you choose the design you did?
I integrated each feature as its own page. I know this does not look the best but I already had a separate page for every other feature so I just continued my pattern. I could have done waht the profesor suggested and have a data table where I can easily add rows, edit rows and delete rows all from table. However this would necesitate me doing a lot of refactoring so I chose not to do it.
b. What parts, if any, did you struggle with when implementing edit/delete in the UI? Surprinsingly I sutrggled with getting a confirmation alert up before trying to delete an item. This was difficult because I could not figure out what element I could sue to get that done. Finally I found the default confirm element and it all clicked into place. Other than that it was all fairly straight forward for me, especially because I have everying on its own page so I didn't have to worry about updating the other states or tables live after an edit or delete.
3. Material UI
a. How did you feel about Material UI's API and its look and feel?
I have worked extensively with Material UI before and it felt pretty easy to work with in general. I know some of the core components and how they plug in to the UI. Things like cards and boxes and data tables are just abstractions on already existing html elements so they are very intuitative. The look is pretty crisp but also pretty generic as everyone uses these elements these days.
b. How easy was it to refactor your existing UI to use Material UI?
I think it was pretty easy to refactor everything except the styling. I tried to play around with the sx styles to get what I had beforehand and it was hard to replicate exactly what I had, but oh well it looks better overall.