1
e02
CS56 f19
PLEASE DO NOT WRITE IN THIS AREA! Name:
UCSB Email address:

EXAM: e02: Final Exam 7:30-10:30pm

ready? date points
true Tue 12/10 07:30PM

You may not collaborate on this exam with anyone. If you need to use the restroom, you must leave your cell phone with the exam proctor before leaving the room.

  • Write your name at the top of this page AND EVERY ODD NUMBERED PAGE.
  • Double check that you turned in ALL pages; look for "End of Exam" on the last page.
  • This exam is closed book, closed notes, closed mouth, cell phone off.
  • You are permitted one sheet of paper (max size 8.5x11") on which to write notes.
  • This sheet will be collected with the exam, and might not be returned.
  • Please write your name on your notes sheet.

  1. Throughout lab07, you added features, refactored, and fixed bugs in a Spring Boot application. As you worked, each time you created a feature branch, did a pull request, and then merged the pull request into master.

    1. (5 pts) What would you type at the shell command line to create a new feature branch called cgFixBugOnHomePage?

      (In this case, assume cg stands for your initials because your name is, let’s say, “Chris Gaucho”.)

    2. (5 pts) What does it mean to create a “pull request”, and how do you create one? (describe briefly)

    3. (5 pts) Suppose you created a pull request for the cgFixBugOnHomePage and then you subsequently merged it into the master branch. What command or commands should you then type at the command prompt before creating another feature branch called cgAddPuppiesToMenu?

  2. (10 pts) Some questions on this exm are of the form:

    Suppose you are at a job interview and the interviewer asks you about _______. How do you respond?

    In each case, your answer will be on correctness and clarity, in the context of whether the answer would help or hurt your chances of landing the job. Your answer should be:

    • Not too long, and rambling. That annoys the interviewer and wastes time.
    • Not too short. It’s too short if it leaves out so much detail that the the interviewer isn’t sure whether you really understand the concept.

    This time, the interviewer says this:

    I see on your resume that you have some experience with developing Spring Boot web applications. So, Spring Boot is a “framework”. How would you explain what a “framework” is, how working with a framework differs from conventional programming, and what the pros/cons are? That is, what advantages do you get from using a framework, and what downsides are there?

    How do you answer the interviewer’s question? Confine your answer to the space provided, and cover all of the points the interviewer asked about.

  3. (20 pts) Another job interview question.

    This time, the interviewer says this:

    When developing a web app, you can run a test of it on localhost, and you can also test it on Heroku. What is the difference? What’s really happening when you run it on localhost vs. when you run it on Heroku?

    Give an answer that covers at least these points:

    • What it means to run on localhost
    • What it means to run on Heroku
    • Any limitations of running on localhost you are aware of that are significant
    • Any limitations of running on Heroku you are aware of that are significant

    Confine your answer to the space provided.

  4. This question revisits lab07 and the Spring Boot application you worked on.

    1. (10 pts) When dealing with APIs as a source of data, we often have to process data that is in JSON format. Suppose there is a student with first name Chris, last name Gaucho and perm number 1234567. How could you represent that data in JSON format?

      (I’m looking for the general idea more than the exact syntax; if you get the syntax mostly right, you’ll get most of the credit. Having said that, full credit goes to folks that get the JSON syntax correct.)

    2. (20 pts) As a reminder, methods of a class called ObjectMapper provided by a package called Jackson can be used to convert between JSON and Java objects that follow the Java Bean standard using a process called “Reflection” that we described in lecture.

      Refer back to the JSON in the previous example, with fields for first name, last name, and perm number. Write the full code for a Java class called Student that you’d need in order to use ObjectMapper to convert between student objects represented in JSON and Java Student objects. (It should fix easily into the space provided.)

  5. This question revisits lab07 and the Spring Boot application you worked on. Answer briefly, in the space provided.

    1. (10 pts) One of the changes you made to the application was to add support for GitHub OAuth. From the standpoint of the end user, that is, the person using your application, what capability did this add to the application?

    2. (5 pts) Another change involved creating a class an annotation @Entity. What is the role of an @Entity class in a Spring Boot application?

    3. (5 pts) @Entity classes are related to @Repository classes. What is the relationship between an @Entity and a @Repository in a Spring Boot application?

    4. (5 pts) In the pom.xml file, you were often asked to add XML code such as the following into the <dependencies> section of the pom.xml. What was the purpose of doing so, i.e. what is the change that takes place when you compile, run, or test your application before and after adding code like this into the <dependencies> section?

          <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
          </dependency>
      
  6. This page intentionally left blank.
End of Exam