UMass Lowell Dept. of Computer Science

COMP 4620 — GUI Programming II

Spring 2016 Semester, Section 201

Prof. Jesse M. Heines

Notes for Class No. 13

Review of In-Class Usability Tests and Continuing with MongoDB

Thursday, March 3, 2016

A video of this class is (or will be) posted at:  http://echo360.uml.edu/heines2016/comp4620-201.html


Handouts and Materials


Openings / Announcements / Reminders

Free course on Ember (after free sign-up)

http://campus.codeschool.com/courses/try-ember/contents

Additional free courses this weekend, March 4-6

https://www.codeschool.com/free-weekend


Class Notes

Related reading for this class:  Handouts and GetMEAN: Chap. 6


Review of Alpha Version Usability Testing

Your comments on each others’ projects


Writing a REST API (Ch. 6, continued)


Syntactic Details

Review from last Thursday’s class ...

Each CRUD operation has a URL path and optional parameters (p. 163)

The requests are differentiated by the method that each operations uses (or with which each URL path is called) (p. 163)

Putting these two together we get (p. 164)

When subdocuments are involved, we add the subdocument path to the URL (pp. 164-165)

New material begins here ...

Response and status codes (p. 165)


Implementation Details

Starting on p. 167, Holmes goes through all the code to create the REST API

  1. Be careful with file locations
  2. Note that in the text, Holmes defines function sendJsonResponse at the bottom of page 170 and uses it throughout the chapter

  3. Postman is discussed on page 173
  4. We saw the find command in our last class (p. 174)
  5. Given the issues that we’ve had recognizing code patterns in previous snippets, let’s make sure that everyone understands the one on page 174:
  6. The discussion on page 175 of how to use function locationsReadOne is critically important
    • here is the function in our API that we want to call
  7. Page 176 reiterates the admonition in Figure 6.3: “Your API code must never leave a request unanswered.”
  8. Remember that to find a subdocument, you first have to find its parent (p. 177)
     
  9. To limit the data returned for a found record, use the select method chained to a model query (p. 179)

  10. Even though I said that we’re not going to worry about geolocation, the structure of the code on page 183 is important to understand

    • what, exactly, is going on here?
       
  11. Note the amount of error trapping that Holmes includes in his code in Listing 6.3 on pp. 179-180


This is document http://jesseheines.com:8080/~heines/91.462/91.462-2015-16s/462-lecs/lecture13.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.