Week 7 Class 12 Tue Feb 23 Posted: Feb 23

Class session:

After the screencast on Project 2 and the Structure Chart exercise, there are 3 options for the remainder of the class session:

A Study for the Midterm Exam. View the screencasts after the Midterm Exam or when you work on parts v2b and up in Project 2.

B Start work on Project 2, v2a, where you correct issues from Project 1 (see announcement below). View the screencasts after the Midterm Exam or when you work on the rest of Project 2.

C View the screencasts now.

  1. Announcements:
  1. Screencast: Project 2 post
  2. Exercise 33: Structure Chart

    The Docker Report program has an internal alternative design in the branch alternative. To view the alternative design, clone the repository OOPS21-DockerReport. Then, switch to this branch using the command:

    git checkout alternative

    In this design, the free functions in yaml_parser.cpp call another set of functions local to the file yaml_parser.cpp, e.g., skipWhitespace(). The purpose of these local functions is to perform further algorithmic decomposition. They are not for use in any other program or file.

    A function definition in any .cpp file can be linked to, even without an include file. For free functions to be completely private to a file, there are two choices. One is the use of the static keyword, e.g., static void f() {...} can only be called in the file that contains the declaration. The more C++ way is to use an anonymous namespace, e.g., namespace { ... }. Anything in an anonymous namespace can only be called in the file that contains that namespace.

    Your assignment is to create a Structure Chart for this alternative design. All of the functions in this alternative design should be in the chart. Label the topmost node Generate Docker Report. All function definitions that are in the alternative design need to appear in the chart. The resulting chart should have 3 levels. The Algorithmic Decomposition Notes contains examples including Generate Payroll and Rainfall.

    Submit to Brightspace as a PDF or any image file. A photo using your phone is fine. If you want to use a drawing program, go ahead and do so.

  3. Screencast: Docker Report: Extract Class Wrapper

    If you are following along in your own repository, there is a change to the CMakeLists.txt file for the build to find YAMLParser.obj. Change:

     # Source files for the main program DockerReport
     set(SOURCE DockerReport.cpp yaml_parser.cpp)
    

    to:

     # Source files for the main program DockerReport
     set(SOURCE DockerReport.cpp YAMLParser.cpp yaml_parser.cpp)
    
  4. Screencast: Docker Report: Replace Parameters with Fields
  5. Screencast: Docker Report: Moving Container and Iterator into the Class

Screencast Folder: Class 12 Tue Feb 23

Exercise Due Date: 4 pm on Wednesday, Feb 24

Reminders: