Once you log into Brightspace, you can find the screencasts via the above links and in the folder Class 26 Thu Apr 30 in the Class Sessions/Folders For Screencasts. As a backup,
there is a link in Brightspace and Discord to a shared Dropbox folder (see announcement below).

Once you log into Brightspace, you can find the screencasts via the above links and in the folder Class 25 Tue Apr 28 in the Class Sessions/Folders For Screencasts. As a backup,
there is a link in Brightspace and Discord to a shared Dropbox folder (see announcement below).

The Final Exam is Thu May 7, 2:30 - 4:30 pm. You have a strict 2 hours (105 minutes + 15 minute “grace period”) to complete the exam. After the exam time is over, no further submission is possible.

Please check the calendar for my Finals Week Office Hours. I am online in the Discord server cs421UA, and also available by appointment.

Project XMLFramework (Project 4) is due by Friday, May 8 (11:59:59 pm).

The Final Exam will be taken via Brightspace, under Assessments/Quizzes and Exam, which brings up the “Quiz and Exam List” with the title Final. It is run the same way as the Midterm, except you have a full 2 hours.

During the Final Exam, I am online in the Discord server cs421UA, channel #class. There you can view any general announcements, e.g., “Final Exam posted”, or direct message me with specific questions.

The Final Exam is open book and open note.

Parts in green are questions on the exam where your answer comes from Project 4. You will not answer these question on the exam. I will take your answers from your work on Project 4.

You are responsible for the following:

UML multiplicity, generalization (inheritance), composition, and aggregation. Understand the difference between composition and aggregation, and when we would use one over the other.

Extension points: Three implementations: A) Direct inheritance from a Base class, B) Inheritance from Handler used by a Base class, C) C++ Templates (e.g., class XMLDocumentTemplateParser). Be able to compare and implement at least two of these approaches on a small code example.

RAII - What it means, why it is important, how to implement

Coupling - Definition, why decoupling is important

Dependency Injection - general concepts

Encapsulation & Information Hiding - Definition. Given code, show how to improve the code to support both.

Note: Provided code had a problem with the parser factory. Apply the FactoryFix.patch to fix. If you have
worked on the @TODO on the factory method, you may not be able to directly apply the patch. Look at the contents and see if you can adapt it. If not, let me know and I
will directly make the change. Also, there is an example of Singleton using std::shared_ptr

The project is a critical part of your overall grade in the course. Parts of this project count toward 50% of the questions on the Final Exam. Consider much of this project as a take home part of the Final Exam. No matter how you performed on the previous projects, you need to commit work on this project.

The project is due by 11:59:59 pm on Friday, May 8. The weight of the project is one project or two projects, whichever leads to a higher grade.

A framework for XML processing would include:

Parsing XML with a variety of push and pull parsers

XPath evaluation - XPath is an addressing language for XML

XSLT transformation - XSLT is a transformation language for XML

Combining these operations as needed by the applications

The open-layered architecture framework, XMLFramework, supports all this and includes:

Applications

Applications using the XMLFramework

xmlpipeline.cpp - CLI for using the framework

XMLFramework

As described above

XMLToolkit

Set of C++ classes for processing XML

Used to implement the XMLFramework, but can be used directly

Where your XMLParser lives

XMLLibrary

Set of C functions for processing XML

Used to implement the XMLToolkit, but can be used directly

There is much code in the project already. One of your tasks is to finish the remaining @TODOs. Follow the following workflow:

Decide on a // @TODO ... to complete

Implement the // @TODO ...:

Implement a part of the // @TODO ...

Your added code comments should not mention that you implemented an @TODO

Commit noting in the commit message what you added

When finished with a // @TODO ... item, remove the comment that contains the// @TODO ...

Note that at no time can a single commit change more than one of the // @TODO ...s. A @TODO may require multiple changes that take multiple commits. At all times, the code should build and run.

The work involved is:

(60%) Complete any @TODOs. All @TODOs are worth the same amount

(10%) Fill in the @pattern and @role comments for all classes

(10%) Document the use of design patterns in the markdown file DESIGN.md. Each instance of a design pattern in XMLFramework must be listed, including the collaborators.

(10%) Document the architectures used in the XMLFramework in the markdown file ARCHITECTURE.md

(10%) Draw a UML diagram of the entire project and put in the file UML.pdf

Notes:

Some of the work involves topics presented during the last week of class, including language features and design patterns. However, you can start right away as some of the work involves topics we have covered.

The answers to some questions on the Final Exam are from your work on this project. E.g., so instead of you creating a UML diagram and uploading it during the Final Exam time, your UML diagram from this project is your Final Exam answer. You must do these parts as they also count toward the Final Exam.

CMakeLists.txt is provided, with a build directory. You are free to add files to the subdirectories. Any files in the apps directory are assumed to be executable files.

The project uses a git submodule. You must follow the directions in SETUP.md before you build. Also, take a look at BUILD.md

In XMLFramework, the app, xmlpipeline, uses CLI11 for parsing command-line options. The file downloads when you run cmake.
Depending on many settings on Windows, the download may be unsuccessful and quietly result in an empty file. As a work-around, directly download the file CLI11.hpp and save it in the directory XMLFramework/build/external/.

To quickly find code, git grep works well. For all the lines of code that contain @TODO, enter the command git grep "@TODO" in the top directory of the project. To see only the filenames, git grep -l "@TODO". The command depends on the directory where you issue the command, e.g., if in the directory framework, the results are for that directory and its subdirectories.

The GitHub Classroom invitation link is on Brightspace. There is also a separate emailed invitation to join the team cs421S20 at the organization UAComputerScience. This membership is necessary for access to the git submodule library.

Once you log into Brightspace, you can find the screencasts via the above links and in the folder Class 24 Thu Apr 23 in the Class Sessions/Folders For Screencasts. As a backup,
there is a link in Brightspace and Discord to a shared Dropbox folder (see announcement below).

We had lots of Brightspace/Panopto issues yesterday, including missing folders and videos for
other classes (in other departments). Found out that something corrupted my Panopto folder. Anyhow, there is a link to a Dropbox folder as a backup.

NOTE Having an issue making this visible. Am working on it. You may be able to see
the score, but not the feedback. This is under Assessments/Quizzes and Exams.

Note: Questions 8 - 10 (the NodeDepth questions) were initially all in one 30-point question. For display in a Brightspace test, I had to split the 30-point question into 3 separate “Written Response” 10-point questions. I graded this as one question, so treat the total of Questions 8 - 10 as out of 30.

If you have any questions, email on Tuesday Apr 21, or direct message on Discord during office hours.

Special Note:Panopto (where the screencasts are served from) is having issues. Panopto is back up.
If you can’t get to the screencasts via Brightspace and the links below, there is a shared
link to a Dropbox folder in the Discord chat.

Project 3 continues the work on srcFacts. It is due at 11:59:59 Apr 23, and involves the following stages:

Tag “v3a”: Redesign XMLParser to use the Template Design Pattern. This pattern uses virtual methods as extension points. Create a new class srcFactsParser (in the new files srcFactsParser.hpp and srcFactsParser.cpp) that inherits from class XMLParser. Instead of lambda callbacks, it will use virtual methods.

Your XML parser should provide access to all parts of XML, even if srcFacts does not use it, via the following extension points (i.e., virtual methods):

Tag “v3b” Extract a “handler” from XMLParser called XMLParserHandler, a new class that only handles the user-defined processing (what we previously had as callbacks). Put the entire XMLParserHandler class in the file XMLParserHandler.hpp. Change srcFactsParser to inherit from XMLParserHandler.

Keep in mind:

You are required to implement these steps in the order given, i.e., v3a, then v3b

At every commit, make sure the project compiles, builds, and produces the correct answer.

The rest of the projects in this course require a recent version of CMake, preferably v3.17, with v3.14 as a minimum.

After updating cmake in your development environment, upload a screenshot, cmake.pdf, that demonstrates your cmake version. You can view this via the following command:

This is an exercise due by 11:59:59 pm Tue Apr 14, but I encourage you to do this before Tuesday.

macOS

Using brew to install cmake provides a recent version. If you have not already installed brew, please do so. To make sure it is installed with the most recent version, enter the following commands in a terminal:

WSL (Windows Subsystem for Linux)

On Windows, the WSL may be an older install of Ubuntu Linux. In this distribution, the cmake version is 3.10, which is not very recent.

Kitware has an APT repository for Ubuntu. To update CMake in Ubuntu, enter the following:

A version of these instructions with more information is at https://apt.kitware.com. The install used steps 1, 2, 3 (for Ubuntu 18.04), and at the end.

Linux

Instructions depend on the distribution. If you are using an older version of Ubuntu, follow the WSL instructions. If you are using a Docker container, where sudo is not used, here are the command for a Kitware APT Setup Docker

The Midterm is during class time on Thu Apr 9. It starts at 1:15 pm with 75 minutes to complete the exam (1:15 - 2:30 pm) and a 15 minute grace period (2:30 - 2:45 pm). I am giving you the grace period due to the different forms of the exam questions, e.g., you have to upload diagrams. After the grace period, no further submission is possible.

During the Midterm, I am online in the Discord server cs421UA, channel #class. There you can view any general announcements, e.g., “Midterm posted”, or direct message me with specific questions. I strongly encourage you to set this up using the link on the Brightspace course page. You are welcome to send me a direct message at any time before the Midterm to practice.

The Midterm has questions of the form:

Discussion (written response)

Diagrams (draw and upload as an Assignment)

Given code, write more code

All three types are in the practice exam “Midterm Practice” under Assessments/Quizzes and Exam, which brings up the “Quiz and Exam List” (yes, that is inconsistent). This exam is not a review for the content of the Midterm but allows you to practice the format. I encourage you to try the “Midterm Practice” exam.

As I don’t have a good way to give them back, previous exercises completed in class that were not yet returned were scanned and entered into Brightspace

The Good Practices is updated, and now includes good practices for classes along with display improvements

The UML diagrams in the notes recently broke, but are now fixed. The online UML tool yuml changed their parser for their format; many diagrams did not work, and they introduced ads. I ended up getting a paid account.

The Notes page has a guide to using Docker for Linux builds to use in the future. Setting up Docker is not required and is entirely optional.

We are following our regular class schedule of Tuesday and Thursday at 1:15 - 2:30 pm

By class time, the announcements, lectures, and exercises will be posted. I strongly suggest that if at all possible that you reserve class time for going through the class material

The announcements and lecture are recorded using Panopto and posted as mp4 files, and available via Brightspace. They will be available during and after class time.

As you are viewing the announcement and lectures during class time, I will be online in a chat/discussion (TBA), and available via email, for any questions or issue.

There will be exercises to complete, as we have been doing

Office Hours are during my regular times where I will be available via chat/discussion, and possibly video

Note that this is a change for all of us, and there will be issues. Be sure to let me know
of any questions about the content and problems with getting the content. Adjustments
are going to be made over time.

The due date for Project 2 is moved to Friday, April 3 Tuesday, April 7.

We were supposed to have a Midterm Exam on Thursday, March 19 (would have been announced on Thursday, March 12). That will be “announced” on Thursday, April 2, and then scheduled for Thursday, April 9.

The Good Practices is updated, and now includes good practices for classes along with display improvements

If you are working on Project 2 and get to tag v2e, you can take a look
at the example (in the Notes) for CSV Callback, an example
of class IOC (Inversion Of Control) with classes.

The UML diagrams in the notes recently broke, but are now fixed. The online UML tool yuml changed their parser for their format; many diagrams did not work, and they introduced ads.

I posted a guide to using Docker for Linux builds to use in the future. Setting up Docker
is not required and is entirely optional.

I have been and am still available for questions if you are working on the project.

The due date for Project 2 is moved to Friday, April 3 Tuesday, April 7

We were supposed to have a Midterm Exam on Thursday, March 19 (would have been announced on Thursday, March 12). That will be “announced” on Thursday, April 2, and is scheduled for Thursday, April 9.

The Good Practices is updated, and now includes good practices for classes along with display improvements

If you are working on Project 2 and get to tag v2e, you will want to take a look
at the example (in the Notes) for CSV Callback, an example
of class IOC (Inversion Of Control) with classes.

I posted a guide to using Docker for Linux builds. This will be used for the March 31 class meeting (our first class back). This is not required and is entirely optional.

After we return on March 30:

Lectures will be in an online form during the regular class time. Exercises to be completed during class time will be assigned.

Office Hours will be during my regular times available via chat/discussion and WebEx (or some video form)

All UA faculty are working now and over Spring Break to move courses online. There are still many questions about the best form for doing that, so changes are possible even after we return on March 30.

I am available for questions over the next couple of weeks if you are working on any projects. However, note that you
are not expected or required to work on the project. As the Provost stated, think of this as an extended Spring Break.

Tag “v2a” Implement and close all issues from Project 1. When you finish fixing an issue, create a tag for that commit in the form issueN tag where N is the issue number, e.g., when you complete issue1, create the tag issue1.

Tag “v2b” Create the class XMLParser in files XMLParser.hpp and XMLParser.cpp where the methods call the free functions from xml_parser.hpp. For this step, do not use any fields/data members, i.e., your method parameters should be very similar to the free function parameters.

Tab “‘v2c’” Eliminate any parameters in the XMLParser methods that you can, replacing them with field/data members in the class. Do this one field/data member at a time.

Tab “v2d” Inline the calls to the xml_parser free functions into your XMLParser methods. Do this one free function call at a time. At the end, your XMLParser.cpp should have no calls to xml_parser functions, and will not need to include xml_parser.hpp.

Tag “v2e” Use inversion of control on the while loop/nested-if in srcFacts so that the entire loop is inside of XMLParser.

All parts of Project 2 are Due Tuesday, Mar 17 Tuesday, April 7.

At every commit, make sure the project compiles, builds, and produces the correct answer.

Break the application down into modules (i.e., functions), and figure what data needs to be passed in and out of each. The modules are algorithms (i.e., functions), not objects, and represent an action. You can review the notes on Algorithmic Decomposition

Your design will most likely have multiple levels, i.e., some functions break down into lower-level functions.

Turn in your structure diagram with the app description by the end of the class period. Make sure to include the names and emails of everybody in your group.

Notes:

The modules (e.g., “Calculate Net Pay”) are more important than the exact data passed between the modules.

Don’t worry too much about the precise diagram syntax for exchanging data between modules, follow the example.

It may not be straightforward to see how code produced from your design would work for the application

Communication and discussion among the group are almost as important as the resulting diagram.

Checklist:

☐ Modules (functions) have the proper shape
☐ Names of modules (functions) are actions not objects
☐ Data passed between the modules (functions) are shown
☐ All team members names and email addresses are on the diagram and the application description

I created issues for some of the problems that I have seen in your srcFact project. You can view these issues at GitHub (Issues tab next to the Code tab).

If the issue is a bug, you should fix the issue, commit the change, and close the issue.

All of you have at least one issue, a checklist for Good Practices. Basically, check your program for the checklist item, then check the box if it is true. You will be using the checklist during all of Project 1, so for now do not close this issue.

Special Note: You are required to fill out the Checklist issue in your repository as part of Project 1.

One approach to understanding the source code of a system is to know the count of things, including counts of statements, functions, classes, expressions, LOC (Lines Of Code), etc. The program srcFacts does that for you in the form of a report.

Directly parsing C++ source code is very challenging, so the srcFacts code does not directly parse the source code. It uses another tool, srcML, to convert the C++ source code into an XML format. The srcFacts program inputs this XML format. As srcFacts parses the XML, it collects data and produces a report.

The srcFacts program has high scalability and performance as it is quite fast and, for example, can produce a report on the entire Linux kernel in under 20 seconds. However, it is in one large, main program with almost no design. In the current form, it isn’t easy to debug the XML parsing, add additional counts, or even understand what is going on. It includes the code for parsing all parts of XML, but it would be difficult to adapt the XML parsing code for another purpose, e.g., another report. The only way to resuse this code is by copy/paste reuse. It has no modularity, extensibility, or reusability, and specifically no maintainability.

Your task is to take the code, improve the overall design, and extract the XML parsing part of the code. When completed, a set of functions in the files xml_parser.hpp and xml_parser.cpp handle as much of the XML parsing as it can, while the main program, srcFacts.cpp, generates the report using the XML parser functions for parsing.

You do not have to understand how to parse XML. You are only repackaging XML parsing code, not writing from scratch.

You need to work carefully so as not to break the existing code

The repository includes example input

Keep in mind all aspects of design as we discuss them in class

The steps (in order) with the associated (git) tag are:

Tag “v1a” Move the refillBuffer() function into a separate refillBuffer.hpp and refillBuffer.cpp files. Due Feb 6

Tag “v1b” Without changing the design, add the code necessary for the report to include the number of return statements and the number of literal strings. Due Feb 6

Tag “v1c” Extract a set of (free) functions to handle the low-level details of the XML parsing. Each commit can only include a single extracted function (i.e., extract one at a time). Due Feb 18

Tag “v1d” Add the necessary code to count the number of block comments. Due Feb 18

Your repository for this project is through GitHub Classroom. A link to create the repository is available on the Brightspace course page. Make sure to login to the GitHub account that you are going to use before you click the link.

There are no classes to write in this assignment. You are creating a library of free functions, e.g., similar to the average() and max() functions that we extracted from the rainfall program.

Be sure to follow the good practices we discuss in class

The main program handles XML errors (invalid XML format) by a return 1; so that the program exits with the status of 1. To exit the program from within any function, use exit(1); which requires the include file stdlib.h.

There are absolutely no classes created for this project. You are extracting a set of free functions. Any class that you would create to solve this problem now would not solve the main issue of how the srcFacts code uses an XML parser.

While you are free to create and use other branches, only the work on the master branch counts. The master branch is the default when you git clone and git checkout.

The picture below is on the entrance to a local parking garage. It usually shows the number
of parking spaces available.

So, the bash shell is everywhere:

on Linux distributions

on macOS (based on BSD Unix)

and even on Windows in the WSL (Windows Subsystem for Linux)

Being able to use the bash shell is an essential skill for modern development.

Further details:

There are many related UNIX shells, including sh, zsh, etc. They are more alike than dissimilar.

Windows has a limited Command Prompt (e.g., cmd.exe), PowerShell, a shell for system administrators, and Cygwin, which provides a UNIX-like environment. At this point,
go with WSL instead, which is a standard Linux Ubuntu distribution. Cygwin
requires special software builds.

Starting with macOS Catalina, the default shell on macOS is zsh instead of bash. bash is still available, but due to licensing issues, the installed version is an older version.

On macOS, install Homebrew, where you can install an updated bash, plus many other GNU utilities.

Upload the screenshots (or screenshot if you can get it all in one) to Brightspace under the assignment IDE. The name of the screenshot is Screenshot.pdf, or Screenshot1.pdf and Screenshot2.pdf if you need two.

If you experience any issues with getting this working, do not panic. Please do what you can, and contact me for assistance. The purpose of this assignment is to solve issues now instead of later.