Week 13 Class 24 Thu Apr 10 Posted: Apr 10
After Class
Project 3: Class Diagram Score and feedback in Brightspace. Not in issues this time.
Going to work on the Sequence Diagram score and feedback next. Last is the scores for each tag. Note that I am done with the issues.
Announcements
Project 3
All issues created for tags. Working on feedback on diagrams, and scores on all parts. Reminders:
Extension points for XML and the attributes passed as parameters can only be the following:
XML Extension Point | Attributes |
---|---|
Start Document | |
XML Declaration | version, encoding, standalone |
Element Start Tag | qName, prefix, localName |
Element End Tag | qName, prefix, localName |
Characters | characters |
Attribute | qName, prefix, localName, value |
XML Namespace | prefix, uri |
XML Comment | value |
CDATA | characters |
Processing Instruction | target, data |
End Document |
Saw lots of public methods, ignoring encapsulation and information hiding. The only methods that should be public are parse()
, registering handlers, and perhaps a (very) few get methods. Public methods are for the clients of the class, not for the implementors of the class.
There is a cost to every public method. For a real system, all public methods must have:
It is easier to just limit the interface (i.e., the public methods) to what is essential to the client code.
Exercise 66: Dynamic Dispatch
Feedback is in the file oracle2.txt in the branch feedback in your repository. The oracle2.txt is the difference between the oracle (with the correct answers) and your Base.cpp. If the oracle2.txt is empty, then that means your answer is correct (reflected in your score). Even if your answer is correct the oracle2.txt may show some differences. The differences were manually examined and I used more direct techniques to determine if there were any static dispatch in your answer.
There is a strong possibility that this will be in a question on the Final Exam.
Exercise 68: FileIO
Please read over the feedback in Brightspace. Even if you got a 10 points, there may be feedback as to your comments or coding style.
// virtual ...
for a comment of a method (or destructor). The keyword virtual
tells us that. The following are examples of substandard comments for destructors:Agenda
Take the code for Exceptions.cpp and perform the following changes:
g()
to 200 in both the code and the output messageh()
in both the code and the output messagef()
to allow the negative value -1 (-2 and smaller is still not allowed)Run the program once for each exception, and show that the exception is thrown.
To demonstrate these changes, you will record a terminal session using asciinema. Submit the terminal session using the form You can use GitHub Codespaces for this as it has asciinema
installed.
Use the GitHub Classroom Exceptions invitation link in Brightspace.
Exercise 75: Design Pattern Factory Method Crossword
Due by 4:30 pm on Fri Apr 11
Exercise 76: Design Pattern Factory Method Quiz
Complete the quiz. Any incorrect answer is a point off out of 10, so answer very carefully.
You will see the correct responses after the due date.
Unless otherwise noted, exercises are due by 4:30 pm on Monday, Apr 14