CPROGRM530-Notes
Course 3: Advanced C++ Programming
These are my personal study notes for the third course in the C++ Programming Professional Certificate Program from the University of Washington. This course delves into modern C++ programming with a special emphasis on the Standard Template Library (STL).
In these notes, I've included information not just from the lectures but also from various online sources. I may omit some lecture content that I'm already familiar with. As these notes were crafted in retrospect, please forgive any inaccuracies.
Table of Contents
Week | Topics |
---|---|
1 | Course Intro, Funciton Overloading, Lvalues/Rvalues/Universal References and constexpr |
2 | Object Persistence and Serialization, Iterator Invalidation , First-Class and Second-Class Concepts, Roles of Classes in C++ |
3 | STL Containers and Algorithms |
4 | Iterators |
5 | Design Patterns |
6 | Template Meta-Programming |
7 | I/O, Structure Packing, Endianness, alignas |
8 | Curiously Recurring Template Pattern (CRTP), Mixins, Dependency Injection/Inversion, and the Pimpl Idiom |
9 | Application Binary Interfaces |
10 | Performance Optimization |
Extra Credit | std::string_view |
Homework Assignments: Vector Graphics Library
This course project involves the development of a comprehensive graphics library focused on both vector and bitmap graphics. Initially, the project concentrates on building a 2D vector graphics library (VG
namespace) with classes to represent points, vector graphics, layers, and scenes. It also includes functionalities for XML serialization and deserialization (Xml
namespace) to make these graphics persistent. The project then extends to support Windows bitmap images (BitmapGraphics
and Binary
namespaces), providing the ability to read and write bitmap files. Furthermore, it introduces a user-friendly CodecLibrary
that acts as a dynamic registry for bitmap encoders and decoders. Finally, the project integrates vector and bitmap graphics, allowing for flexible manipulation and projection of graphics through a common Canvas
interface.
Below is a UML diagram that outlines the class structure of the final project:
I like how the assignments were graded in this class. The homework submission process involves adhering to bi-weekly specifications (which essentially provide functional requirements) and making a pull request. Then, the instructor(s) evaluates our code, going through each line in detail, similar to the code reviews they conduct in their daytime jobs as SWEs. This approach has helped my understanding of quality coding practices.
For academic integrity reasons, I won't be posting my code here. However, I will provide a brief overview of the key concepts covered in each homework assignment. Here's a concise overview of the bi-weekly homework assignments:
Weeks | Classes and Structures Implemented | Key Concepts |
---|---|---|
1-2 | Point , VectorGraphic |
<iosfwd> , constexpr , std::erase_if() , other design considerations |
3-4 | Scene , Layer , PlacedVectorGraphic , TinyElement , IElement , ElementFactory , XmlReader , XMLWriter , SceneReader , SceneWriter |
Persistence, Serialization, TinyXML2, Choosing Data Structures, Future Extensibility, friend Methods, Single Responsibility Principle (SRP) |
5-6 | Byte , Word , DoubleWord , WindowsBitmapHeader , BitmapIterator , Bitmap , Color |
Windows Bitmap (BMP), Endianness, explicit , std::enable_if_t , stream.exceptions , static_assert |
7-8 | CodecLibrary , IBitmapEncoder , WindowsBitmapEncoder , IBitmapDecoder , WindowsBitmapDecoder , BitmapIteratorDecorator , ColorInversionDecorator , BrightnessDecorator |
CODEC, Prototype Design Pattern, MIME type |
9-10 | ICanvas , BasicCanvas , IStroke , SquareStroke , IPen , SquarePen , LineIterator , BasicCanvasBitmapIterator , IProjector , WindowsBitmapFileProjector |
Double Buffering, Rendering |