Evaluations
Evaluate our pet service CRUD application.
Qualities
The project has some qualities:
Some thought has gone into organizing the code, and the file names give us a pretty good idea of what’s contained within, even if
helpersandlibcould be more helpful.There are few dependencies, resulting in good performance.It’s quite easy to add a new type of animal as long as no new special behavior is required. Storing information with or without a counter only requires the creation of a new class and routes.
Right now, the code isn’t overly complicated (but this is also due to its being a mere example).
Now, what are the specific issues with this project, and what does that tell us about other projects written in a similar style?
The first issue involves the passing of request, response, and next parameters, something express seems to have made popular in the Node ecosystem. For example:
function queryParamValidation(request, response, next) {if (!request.query) {next();} else {try {// validatenext();} catch (e) {return response.sendStatus(400);}}}
Code issues
Despite its popularity, this approach includes disadvantages. Most important among them is that a lot of code becomes aware of what ...